CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
cryptoType.setAlias(user);
X509Certificate[] certs = crypto.getX509Certificates(cryptoType);
BinarySecurity bstToken = null;
if (!sig.isUseSingleCertificate()) {
bstToken = new PKIPathSecurity(saaj.getSOAPPart());
((PKIPathSecurity) bstToken).setX509Certificates(certs, crypto);
} else {
bstToken = new X509Security(saaj.getSOAPPart());
((X509Security) bstToken).setX509Certificate(certs[0]);
}