/**
* Test that creates, sends and processes a signed SAML 2 attribute assertion.
*/
@org.junit.Test
public void testSAML2AttrAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.ATTR);
callbackHandler.setConfirmationMethod(SAML2Constants.CONF_HOLDER_KEY);
callbackHandler.setIssuer("www.example.com");
SAMLParms samlParms = new SAMLParms();
samlParms.setCallbackHandler(callbackHandler);
AssertionWrapper assertion = new AssertionWrapper(samlParms);
assertion.signAssertion("wss40_server", "security", issuerCrypto, false);
byte[] ephemeralKey = callbackHandler.getEphemeralKey();
WSSecSignatureSAML wsSign = new WSSecSignatureSAML();
wsSign.setUserInfo("wss40", "security");
wsSign.setDigestAlgo("http://www.w3.org/2001/04/xmlenc#sha256");
wsSign.setSignatureAlgorithm(WSConstants.HMAC_SHA256);