if (element == null) {
throw new IllegalArgumentException(
"Trust10 assertion doesn't contain any Policy");
}
Trust13 trust13 = new Trust13(SPConstants.SP_V12);
if (element
.getFirstChildWithName(SP12Constants.MUST_SUPPORT_CLIENT_CHALLENGE) != null) {
trust13.setMustSupportClientChallenge(true);
}
if (element
.getFirstChildWithName(SP12Constants.MUST_SUPPORT_SERVER_CHALLENGE) != null) {
trust13.setMustSupportServerChallenge(true);
}
if (element.getFirstChildWithName(SP12Constants.REQUIRE_CLIENT_ENTROPY) != null) {
trust13.setRequireClientEntropy(true);
}
if (element.getFirstChildWithName(SP12Constants.REQUIRE_SERVER_ENTROPY) != null) {
trust13.setRequireServerEntropy(true);
}
if (element.getFirstChildWithName(SP12Constants.MUST_SUPPORT_ISSUED_TOKENS) != null) {
trust13.setMustSupportIssuedTokens(true);
}
if (element.getFirstChildWithName(SP12Constants.REQUIRE_REQUEST_SECURITY_TOKEN_COLLECTION) != null) {
trust13.setRequireRequestSecurityTokenCollection(true);
}
if (element.getFirstChildWithName(SP12Constants.REQUIRE_APPLIES_TO) != null) {
trust13.setRequireAppliesTo(true);
}
return trust13;
}