messageContext.put(
WSHandlerConstants.PW_CALLBACK_REF, new KeystoreCallbackHandler()
);
reqData.setMsgContext(messageContext);
EncryptionActionToken actionToken = new EncryptionActionToken();
actionToken.setKey(keyData);
actionToken.setSymmetricAlgorithm(WSConstants.AES_128);
actionToken.setKeyIdentifierId(WSConstants.SKI_KEY_IDENTIFIER);
actionToken.setUser("wss40");
actionToken.setCryptoProperties("wss40.properties");
actionToken.setTokenId(IDGenerator.generateID("EK-"));
SignatureActionToken actionToken2 = new SignatureActionToken();
actionToken2.setKeyIdentifierId(WSConstants.CUSTOM_SYMM_SIGNING);
actionToken2.setKey(keyData);
actionToken2.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);
actionToken2.setTokenType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
actionToken2.setTokenId(actionToken.getTokenId());
final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
CustomHandler handler = new CustomHandler();
List<HandlerAction> actions = new ArrayList<HandlerAction>();
actions.add(new HandlerAction(WSConstants.SIGN, actionToken2));