protected void validateAssertion(final Assertion assertion, final SAML2MessageContext context,
                                     final SignatureTrustEngine engine, final Decrypter decrypter) {

        if (!assertion.getVersion().equals(SAMLVersion.VERSION_20)) {
            throw new SAMLException("Invalid SAML assertion version");
        }

        validateIssueInstant(assertion.getIssueInstant());

        validateIssuer(assertion.getIssuer(), context);

        if (assertion.getSubject() != null) {
            validateSubject(assertion.getSubject(), context, decrypter);
        } else {
            throw new SAMAssertionSubjectException("Assertion subject cannot be null");
        }

        validateAssertionConditions(assertion.getConditions(), context);

        validateAuthenticationStatements(assertion.getAuthnStatements(), context);

        validateAssertionSignature(assertion.getSignature(), context, engine);
    }
Validate the given assertion:
- issueInstant
- issuer
- subject
- conditions
- authnStatements
- signature

@param assertion the assertion
@param context   the context
@param engine    the engine
@param decrypter the decrypter
pac4j-saml/src/main/java/org/pac4j/saml/sso/impl/SAML2AuthnResponseValidator.java