Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
SecurityTokenReference secToken = new SecurityTokenReference(doc);
CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
cryptoType.setAlias("wss40");
X509Certificate[] certs = crypto.getX509Certificates(cryptoType);
secToken.setKeyIdentifierSKI(certs[0], crypto);
WSSecDKSign sigBuilder = new WSSecDKSign();
java.security.Key key = crypto.getPrivateKey("wss40", "security");