SAMLParms samlParms = new SAMLParms();
samlParms.setCallbackHandler(callbackHandler);
AssertionWrapper assertion = new AssertionWrapper(samlParms);
assertion.signAssertion("16c73ab6-b892-458f-abf5-2f875f74882e", "security", crypto, false);
WSSecSAMLToken wsSign = new WSSecSAMLToken();
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
Document signedDoc = wsSign.build(doc, assertion, secHeader);
if (LOG.isDebugEnabled()) {
LOG.debug("SAML 1.1 Authn Assertion (holder-of-key):");
String outputString =
org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);