Package com.sun.identity.saml2.assertion
Interface Assertion
-
- All Superinterfaces:
XmlSerializable
@SupportedAll public interface Assertion extends XmlSerializable
TheAssertionelement is a package of information that supplies one or moreStatementmade by an issuer. There are three kinds of assertions: Authentication, Authorization Decision, and Attribute assertions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EncryptedAssertionencrypt(com.sun.identity.saml2.key.EncryptionConfig encryptionConfig, String recipientEntityID)Returns anEncryptedAssertionobject.AdvicegetAdvice()Returns the advice of the assertionList<AttributeStatement>getAttributeStatements()Returns the attribute statements of the assertionList<AuthnStatement>getAuthnStatements()Returns theAuthnStatementsof the assertionList<AuthzDecisionStatement>getAuthzDecisionStatements()Returns theAuthzDecisionStatementsof the assertionConditionsgetConditions()Returns the conditions of the assertionStringgetID()Returns the id of the assertionDategetIssueInstant()Returns the time when the assertion was issuedIssuergetIssuer()Returns the issuer of the assertionStringgetSignature()Returns the signature of the assertionList<Object>getStatements()Returns the statements of the assertionSubjectgetSubject()Returns the subject of the assertionStringgetVersion()Returns the version number of the assertion.booleanisMutable()Returns true if the object is mutablebooleanisSignatureValid(Set<X509Certificate> verificationCerts)Return whether the signature is valid or not.booleanisSigned()Return true if the assertion is signedbooleanisTimeValid()Gets the validity of the assertion evaluating its conditions if specified.voidmakeImmutable()Makes the object immutablevoidsetAdvice(Advice advice)Sets the advice of the assertionvoidsetAttributeStatements(List<AttributeStatement> statements)Sets the attribute statements of the assertionvoidsetAuthnStatements(List<AuthnStatement> statements)Sets theAuthnStatementsof the assertionvoidsetAuthzDecisionStatements(List<AuthzDecisionStatement> statements)Sets theAuthzDecisionStatementsof the assertionvoidsetConditions(Conditions conditions)Sets the conditions of the assertionvoidsetID(String id)Sets the id of the assertionvoidsetIssueInstant(Date issueInstant)Sets the time when the assertion was issuedvoidsetIssuer(Issuer issuer)Sets the issuer of the assertionvoidsetStatements(List<Object> statements)Sets the statements of the assertionvoidsetSubject(Subject subject)Sets the subject of the assertionvoidsetVersion(String version)Sets the version number of the assertion.voidsign(org.forgerock.openam.saml2.crypto.signing.SigningConfig signingConfig)Signs the Assertion.-
Methods inherited from interface com.sun.identity.saml2.common.XmlSerializable
toDocumentFragment, toXMLString, toXMLString
-
-
-
-
Method Detail
-
getVersion
String getVersion()
Returns the version number of the assertion.- Returns:
- The version number of the assertion.
-
setVersion
void setVersion(String version) throws SAML2Exception
Sets the version number of the assertion.- Parameters:
version- the version number.- Throws:
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 SAML2Exception
Sets the time when the assertion was issued- Parameters:
issueInstant- the issue time of the assertion- Throws:
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 SAML2Exception
Sets the subject of the assertion- Parameters:
subject- the subject of the assertion- Throws:
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 SAML2Exception
Sets the advice of the assertion- Parameters:
advice- the advice of the assertion- Throws:
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 SAML2Exception
Sets the conditions of the assertion- Parameters:
conditions- the conditions of the assertion- Throws:
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 SAML2Exception
Sets the id of the assertion- Parameters:
id- the id of the assertion- Throws:
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 theAuthnStatementsof the assertion- Returns:
- the
AuthnStatementsof the assertion
-
getAuthzDecisionStatements
List<AuthzDecisionStatement> getAuthzDecisionStatements()
Returns theAuthzDecisionStatementsof the assertion- Returns:
- the
AuthzDecisionStatementsof 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 SAML2Exception
Sets the statements of the assertion- Parameters:
statements- the statements of the assertion- Throws:
SAML2Exception- if the object is immutable
-
setAuthnStatements
void setAuthnStatements(List<AuthnStatement> statements) throws SAML2Exception
Sets theAuthnStatementsof the assertion- Parameters:
statements- theAuthnStatementsof the assertion- Throws:
SAML2Exception- if the object is immutable
-
setAuthzDecisionStatements
void setAuthzDecisionStatements(List<AuthzDecisionStatement> statements) throws SAML2Exception
Sets theAuthzDecisionStatementsof the assertion- Parameters:
statements- theAuthzDecisionStatementsof the assertion- Throws:
SAML2Exception- if the object is immutable
-
setAttributeStatements
void setAttributeStatements(List<AttributeStatement> statements) throws SAML2Exception
Sets the attribute statements of the assertion- Parameters:
statements- the attribute statements of the assertion- Throws:
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 SAML2Exception
Sets the issuer of the assertion- Parameters:
issuer- the issuer of the assertion- Throws:
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 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:
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) andNotOnOrAfter(current time exclusive) values and true otherwise or if no conditions specified.
-
sign
void sign(org.forgerock.openam.saml2.crypto.signing.SigningConfig signingConfig) throws SAML2Exception
Signs the Assertion.- Parameters:
signingConfig- The signing configuration.- Throws:
SAML2Exception- if it could not sign the assertion.
-
encrypt
EncryptedAssertion encrypt(com.sun.identity.saml2.key.EncryptionConfig encryptionConfig, String recipientEntityID) throws SAML2Exception
Returns anEncryptedAssertionobject.- 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:
EncryptedAssertionobject- Throws:
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
-
-