Package com.sun.identity.saml2.assertion
Interface Assertion
- All Superinterfaces:
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 Summary
Modifier and TypeMethodDescriptionReturns anEncryptedAssertion
object.Returns the advice of the assertionReturns the attribute statements of the assertionReturns theAuthnStatements
of the assertionReturns theAuthzDecisionStatements
of the assertionReturns the conditions of the assertiongetID()
Returns the id of the assertionReturns the time when the assertion was issuedReturns the issuer of the assertionReturns the signature of the assertionReturns the statements of the assertionReturns the subject of the assertionReturns the version number of the assertion.boolean
Returns true if the object is mutableboolean
isSignatureValid
(Set<X509Certificate> verificationCerts) Return whether the signature is valid or not.boolean
isSigned()
Return true if the assertion is signedboolean
Gets the validity of the assertion evaluating its conditions if specified.void
Makes the object immutablevoid
Sets the advice of the assertionvoid
setAttributeStatements
(List<AttributeStatement> statements) Sets the attribute statements of the assertionvoid
setAuthnStatements
(List<AuthnStatement> statements) Sets theAuthnStatements
of the assertionvoid
setAuthzDecisionStatements
(List<AuthzDecisionStatement> statements) Sets theAuthzDecisionStatements
of the assertionvoid
setConditions
(Conditions conditions) Sets the conditions of the assertionvoid
Sets the id of the assertionvoid
setIssueInstant
(Date issueInstant) Sets the time when the assertion was issuedvoid
Sets the issuer of the assertionvoid
setStatements
(List<Object> statements) Sets the statements of the assertionvoid
setSubject
(Subject subject) Sets the subject of the assertionvoid
setVersion
(String version) Sets the version number of the assertion.void
sign
(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 Details
-
getVersion
String getVersion()Returns the version number of the assertion.- Returns:
- The version number of the assertion.
-
setVersion
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
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
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
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
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
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
Returns the statements of the assertion- Returns:
- the statements of the assertion
-
getAuthnStatements
List<AuthnStatement> getAuthnStatements()Returns theAuthnStatements
of the assertion- Returns:
- the
AuthnStatements
of the assertion
-
getAuthzDecisionStatements
List<AuthzDecisionStatement> getAuthzDecisionStatements()Returns theAuthzDecisionStatements
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
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 theAuthnStatements
of the assertion- Parameters:
statements
- theAuthnStatements
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 theAuthzDecisionStatements
of the assertion- Parameters:
statements
- theAuthzDecisionStatements
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
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) 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 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 anEncryptedAssertion
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
-