child = child.getNextSibling();
continue;
}
if ("TokenType".equals(child.getLocalName())) {
String content = child.getTextContent();
final SAMLVersion samlVersion = samlTokenSecurityEvent.getSamlAssertionWrapper().getSamlVersion();
if (WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE.equals(content)
&& samlVersion != SAMLVersion.VERSION_11) {
return "Policy enforces SAML V1.1 token but got " + samlVersion.toString();
} else if (WSSConstants.NS_SAML20_TOKEN_PROFILE_TYPE.equals(content)
&& samlVersion != SAMLVersion.VERSION_20) {
return "Policy enforces SAML V2.0 token but got " + samlVersion.toString();
}
} else if ("KeyType".equals(child.getLocalName())) {
String content = child.getTextContent();
if (content.endsWith("SymmetricKey")) {
Map<String, Key> subjectKeys = samlTokenSecurityEvent.getSecurityToken().getSecretKey();