if (ais == null) {
return true;
}
for (AssertionInfo ai : ais) {
SymmetricBinding abinding = (SymmetricBinding)ai.getAssertion();
ai.setAsserted(true);
if (abinding.getProtectionOrder() == SPConstants.ProtectionOrder.EncryptBeforeSigning) {
if (abinding.isSignatureProtection()) {
if (prots == Protections.ENCRYPT_SIGN
|| prots == Protections.SIGN_ENCRYPT) {
ai.setNotAsserted("Not encrypted before signed and then protected");
}
} else if (prots == Protections.SIGN_ENCRYPT) {
ai.setNotAsserted("Not encrypted before signed");
}
} else if (prots == Protections.ENCRYPT_SIGN) {
ai.setNotAsserted("Not signed before encrypted");
}
if (abinding.getEncryptionToken() != null) {
assertPolicy(aim, abinding.getEncryptionToken());
assertPolicy(aim, abinding.getEncryptionToken().getToken(), derived);
}
if (abinding.getSignatureToken() != null) {
assertPolicy(aim, abinding.getSignatureToken());
assertPolicy(aim, abinding.getSignatureToken().getToken(), derived);
}
if (abinding.getProtectionToken() != null) {
assertPolicy(aim, abinding.getProtectionToken());
assertPolicy(aim, abinding.getProtectionToken().getToken(), derived);
}
}
return true;
}