Integer actInt = (Integer)wser.get(WSSecurityEngineResult.TAG_ACTION);
if (actInt.intValue() == WSConstants.SIGN) {
Principal principal =
(Principal)wser.get(WSSecurityEngineResult.TAG_PRINCIPAL);
if (principal instanceof CustomTokenPrincipal) {
CustomTokenPrincipal customPrincipal =
(CustomTokenPrincipal)principal;
byte[] secretKey =
(byte[])wser.get(WSSecurityEngineResult.TAG_DECRYPTED_KEY);
if (secretKey != null) {
SecurityToken token =
new SecurityToken(
customPrincipal.getName(),
(java.util.Calendar)null,
(java.util.Calendar)null
);
token.setSecret(secretKey);
return token;