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 anEncryptedAssertionobject.Returns the advice of the assertionReturns the attribute statements of the assertionReturns theAuthnStatementsof the assertionReturns theAuthzDecisionStatementsof 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.booleanReturns true if the object is mutablebooleanisSignatureValid(Set<X509Certificate> verificationCerts) Return whether the signature is valid or not.booleanisSigned()Return true if the assertion is signedbooleanGets the validity of the assertion evaluating its conditions if specified.voidMakes the object immutablevoidSets 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 assertionvoidSets the id of the assertionvoidsetIssueInstant(Date issueInstant) Sets the time when the assertion was issuedvoidSets 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 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:
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:
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:
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:
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:
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:
SAML2Exception- if the object is immutable
-
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
Sets the statements of the assertion- Parameters:
statements- the statements of the assertion- Throws:
SAML2Exception- if the object is immutable
-
setAuthnStatements
Sets theAuthnStatementsof the assertion- Parameters:
statements- theAuthnStatementsof the assertion- Throws:
SAML2Exception- if the object is immutable
-
setAuthzDecisionStatements
Sets theAuthzDecisionStatementsof the assertion- Parameters:
statements- theAuthzDecisionStatementsof the assertion- Throws:
SAML2Exception- if the object is immutable
-
setAttributeStatements
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
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
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
-