for (int j = 0; j < results.size(); j++) {
WSSecurityEngineResult wser = (WSSecurityEngineResult) results.get(j);
final Integer actInt =
(Integer)wser.get(WSSecurityEngineResult.TAG_ACTION);
if(WSConstants.ST_UNSIGNED == actInt.intValue()) {
final SAMLAssertion assertion =
((SAMLAssertion) wser
.get(WSSecurityEngineResult.TAG_SAML_ASSERTION));
String id = assertion.getId();
Date created = assertion.getNotBefore();
Date expires = assertion.getNotOnOrAfter();
SAMLKeyInfo samlKi = SAMLUtil.getSAMLKeyInfo(assertion,
signatureCrypto, tokenCallbackHandler);
try {
TokenStorage store = rmd.getTokenStorage();
if(store.getToken(id) == null) {
Token token = new Token(id, (OMElement)assertion.toDOM(), created, expires);
token.setSecret(samlKi.getSecret());
store.add(token);
}
} catch (Exception e) {
throw new RampartException(