Package com.sun.identity.saml2.assertion
Interface Assertion
-
- All Superinterfaces:
XmlSerializable
@SupportedAll public interface Assertion extends XmlSerializable
TheAssertion
element is a package of information that supplies one or moreStatement
made 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 EncryptedAssertion
encrypt(com.sun.identity.saml2.key.EncryptionConfig encryptionConfig, String recipientEntityID)
Returns anEncryptedAssertion
object.Advice
getAdvice()
Returns the advice of the assertionList<AttributeStatement>
getAttributeStatements()
Returns the attribute statements of the assertionList<AuthnStatement>
getAuthnStatements()
Returns theAuthnStatements
of the assertionList<AuthzDecisionStatement>
getAuthzDecisionStatements()
Returns theAuthzDecisionStatements
of the assertionConditions
getConditions()
Returns the conditions of the assertionString
getID()
Returns the id of the assertionDate
getIssueInstant()
Returns the time when the assertion was issuedIssuer
getIssuer()
Returns the issuer of the assertionString
getSignature()
Returns the signature of the assertionList<Object>
getStatements()
Returns the statements of the assertionSubject
getSubject()
Returns the subject of the assertionString
getVersion()
Returns the version number of the assertion.boolean
isMutable()
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
isTimeValid()
Gets the validity of the assertion evaluating its conditions if specified.void
makeImmutable()
Makes the object immutablevoid
setAdvice(Advice advice)
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
setID(String id)
Sets the id of the assertionvoid
setIssueInstant(Date issueInstant)
Sets the time when the assertion was issuedvoid
setIssuer(Issuer issuer)
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 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 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
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 theAuthnStatements
of the assertion- Parameters:
statements
- theAuthnStatements
of the assertion- Throws:
SAML2Exception
- if the object is immutable
-
setAuthzDecisionStatements
void setAuthzDecisionStatements(List<AuthzDecisionStatement> statements) throws SAML2Exception
Sets theAuthzDecisionStatements
of the assertion- Parameters:
statements
- theAuthzDecisionStatements
of 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 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:
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
-
-