WSSecurityEngine newEngine = new WSSecurityEngine();
newEngine.getWssConfig().setPasswordsAreEncoded(true);
newEngine.getWssConfig().setAllowUsernameTokenNoPassword(true);
List<WSSecurityEngineResult> results = newEngine.processSecurityHeader(
signedDoc, null, new EncodedPasswordCallbackHandler(), null
);
WSSecurityEngineResult actionResult =
WSSecurityUtil.fetchActionResult(results, WSConstants.SIGN);
java.security.Principal principal =
(java.security.Principal) actionResult.get(WSSecurityEngineResult.TAG_PRINCIPAL);