Interface Assertion

All Superinterfaces:
XmlSerializable

@SupportedAll public interface Assertion extends XmlSerializable
The Assertion element is a package of information that supplies one or more Statement made by an issuer. There are three kinds of assertions: Authentication, Authorization Decision, and Attribute assertions.
  • Method Details

    • getVersion

      String getVersion()
      Returns the version number of the assertion.
      Returns:
      The version number of the assertion.
    • setVersion

      void setVersion(String version) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the version number of the assertion.
      Parameters:
      version - the version number.
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • getIssueInstant

      Date getIssueInstant()
      Returns the time when the assertion was issued
      Returns:
      the time of the assertion issued
    • setIssueInstant

      void setIssueInstant(Date issueInstant) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the time when the assertion was issued
      Parameters:
      issueInstant - the issue time of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • getSubject

      Subject getSubject()
      Returns the subject of the assertion
      Returns:
      the subject of the assertion
    • setSubject

      void setSubject(Subject subject) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the subject of the assertion
      Parameters:
      subject - the subject of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • getAdvice

      Advice getAdvice()
      Returns the advice of the assertion
      Returns:
      the advice of the assertion
    • setAdvice

      void setAdvice(Advice advice) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the advice of the assertion
      Parameters:
      advice - the advice of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • getSignature

      String getSignature()
      Returns the signature of the assertion
      Returns:
      the signature of the assertion
    • getConditions

      Conditions getConditions()
      Returns the conditions of the assertion
      Returns:
      the conditions of the assertion
    • setConditions

      void setConditions(Conditions conditions) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the conditions of the assertion
      Parameters:
      conditions - the conditions of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • getID

      String getID()
      Returns the id of the assertion
      Returns:
      the id of the assertion
    • setID

      void setID(String id) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the id of the assertion
      Parameters:
      id - the id of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • getStatements

      List<Object> getStatements()
      Returns the statements of the assertion
      Returns:
      the statements of the assertion
    • getAuthnStatements

      List<AuthnStatement> getAuthnStatements()
      Returns the AuthnStatements of the assertion
      Returns:
      the AuthnStatements of the assertion
    • getAuthzDecisionStatements

      List<AuthzDecisionStatement> getAuthzDecisionStatements()
      Returns the AuthzDecisionStatements of the assertion
      Returns:
      the AuthzDecisionStatements of the assertion
    • getAttributeStatements

      List<AttributeStatement> getAttributeStatements()
      Returns the attribute statements of the assertion
      Returns:
      the attribute statements of the assertion
    • setStatements

      void setStatements(List<Object> statements) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the statements of the assertion
      Parameters:
      statements - the statements of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • setAuthnStatements

      void setAuthnStatements(List<AuthnStatement> statements) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the AuthnStatements of the assertion
      Parameters:
      statements - the AuthnStatements of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • setAuthzDecisionStatements

      void setAuthzDecisionStatements(List<AuthzDecisionStatement> statements) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the AuthzDecisionStatements of the assertion
      Parameters:
      statements - the AuthzDecisionStatements of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • setAttributeStatements

      void setAttributeStatements(List<AttributeStatement> statements) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the attribute statements of the assertion
      Parameters:
      statements - the attribute statements of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • getIssuer

      Issuer getIssuer()
      Returns the issuer of the assertion
      Returns:
      the issuer of the assertion
    • setIssuer

      void setIssuer(Issuer issuer) throws com.sun.identity.saml2.common.SAML2Exception
      Sets the issuer of the assertion
      Parameters:
      issuer - the issuer of the assertion
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the object is immutable
    • isSigned

      boolean isSigned()
      Return true if the assertion is signed
      Returns:
      true if the assertion is signed
    • isSignatureValid

      boolean isSignatureValid(Set<X509Certificate> verificationCerts) throws com.sun.identity.saml2.common.SAML2Exception
      Return whether the signature is valid or not.
      Parameters:
      verificationCerts - Certificates containing the public keys which may be used for signature verification; This certificate may also may be used to check against the certificate included in the signature.
      Returns:
      true if the signature is valid; false otherwise.
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if the signature could not be verified
    • isTimeValid

      boolean isTimeValid()
      Gets the validity of the assertion evaluating its conditions if specified.
      Returns:
      false if conditions is invalid based on it lying between NotBefore (current time inclusive) and NotOnOrAfter (current time exclusive) values and true otherwise or if no conditions specified.
    • sign

      void sign(org.forgerock.openam.saml2.crypto.signing.SigningConfig signingConfig) throws com.sun.identity.saml2.common.SAML2Exception
      Signs the Assertion.
      Parameters:
      signingConfig - The signing configuration.
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if it could not sign the assertion.
    • encrypt

      EncryptedAssertion encrypt(com.sun.identity.saml2.key.EncryptionConfig encryptionConfig, String recipientEntityID) throws com.sun.identity.saml2.common.SAML2Exception
      Returns an EncryptedAssertion object.
      Parameters:
      encryptionConfig - The encryption config.
      recipientEntityID - Unique identifier of the recipient, it is used as the index to the cached secret key so that the key can be reused for the same recipient; It can be null in which case the secret key will be generated every time and will not be cached and reused. Note that the generation of a secret key is a relatively expensive operation.
      Returns:
      EncryptedAssertion object
      Throws:
      com.sun.identity.saml2.common.SAML2Exception - if error occurs during the encryption process.
    • makeImmutable

      void makeImmutable()
      Makes the object immutable
    • isMutable

      boolean isMutable()
      Returns true if the object is mutable
      Returns:
      true if the object is mutable