" </wsp:ExactlyOne>";
WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.TIMESTAMP, WSSConstants.USERNAMETOKEN, WSSConstants.SAML_TOKEN_SIGNED, WSSConstants.ENCRYPT_WITH_DERIVED_KEY};
outSecurityProperties.setOutAction(actions);
SAMLCallbackHandlerImpl samlCallbackHandler = new SAMLCallbackHandlerImpl();
samlCallbackHandler.setSamlVersion(SAMLVersion.VERSION_20);
samlCallbackHandler.setStatement(SAMLCallbackHandlerImpl.Statement.AUTHN);
samlCallbackHandler.setConfirmationMethod(SAML2Constants.CONF_HOLDER_KEY);
samlCallbackHandler.setIssuer("www.example.com");
byte[] secret = new byte[128 / 8];
WSSConstants.secureRandom.nextBytes(secret);
CallbackHandlerImpl callbackHandler = new CallbackHandlerImpl();
callbackHandler.setSecret(secret);
KeyStore keyStore = KeyStore.getInstance("jks");
keyStore.load(this.getClass().getClassLoader().getResourceAsStream("transmitter.jks"), "default".toCharArray());
Merlin crypto = new Merlin();
crypto.setKeyStore(keyStore);
CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
cryptoType.setAlias("transmitter");
samlCallbackHandler.setCerts(crypto.getX509Certificates(cryptoType));
outSecurityProperties.setCallbackHandler(callbackHandler);
outSecurityProperties.setSamlCallbackHandler(samlCallbackHandler);
outSecurityProperties.setTokenUser("tester");
outSecurityProperties.setSignatureKeyIdentifier(WSSecurityTokenConstants.KeyIdentifier_EmbeddedKeyIdentifierRef);
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());