com.sun.identity.saml2.assertion
Interface Assertion


public interface Assertion

This object stands for Assertion element. An Assertion 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
 EncryptedAssertion encrypt(java.security.Key recipientPublicKey, java.lang.String dataEncAlgorithm, int dataEncStrength, java.lang.String recipientEntityID)
          Returns an EncryptedAssertion object.
 Advice getAdvice()
          Returns the advice of the assertion
 java.util.List getAttributeStatements()
          Returns the attribute statements of the assertion
 java.util.List getAuthnStatements()
          Returns the AuthnStatements of the assertion
 java.util.List getAuthzDecisionStatements()
          Returns the AuthzDecisionStatements of the assertion
 Conditions getConditions()
          Returns the conditions of the assertion
 java.lang.String getID()
          Returns the id of the assertion
 java.util.Date getIssueInstant()
          Returns the time when the assertion was issued
 Issuer getIssuer()
          Returns the issuer of the assertion
 java.lang.String getSignature()
          Returns the signature of the assertion
 java.util.List getStatements()
          Returns the statements of the assertion
 Subject getSubject()
          Returns the subject of the assertion
 java.lang.String getVersion()
          Returns the version number of the assertion.
 boolean isMutable()
          Returns true if the object is mutable
 boolean isSignatureValid(java.security.cert.X509Certificate senderCert)
          Return whether the signature is valid or not.
 boolean isSigned()
          Return true if the assertion is signed
 boolean isTimeValid()
          Gets the validity of the assertion evaluating its conditions if specified.
 void makeImmutable()
          Makes the object immutable
 void setAdvice(Advice advice)
          Sets the advice of the assertion
 void setAttributeStatements(java.util.List statements)
          Sets the attribute statements of the assertion
 void setAuthnStatements(java.util.List statements)
          Sets the AuthnStatements of the assertion
 void setAuthzDecisionStatements(java.util.List statements)
          Sets the AuthzDecisionStatements of the assertion
 void setConditions(Conditions conditions)
          Sets the conditions of the assertion
 void setID(java.lang.String id)
          Sets the id of the assertion
 void setIssueInstant(java.util.Date issueInstant)
          Sets the time when the assertion was issued
 void setIssuer(Issuer issuer)
          Sets the issuer of the assertion
 void setStatements(java.util.List statements)
          Sets the statements of the assertion
 void setSubject(Subject subject)
          Sets the subject of the assertion
 void setVersion(java.lang.String version)
          Sets the version number of the assertion.
 void sign(java.security.PrivateKey privateKey, java.security.cert.X509Certificate cert)
          Signs the Assertion.
 java.lang.String toXMLString()
          Returns a String representation
 java.lang.String toXMLString(boolean includeNSPrefix, boolean declareNS)
          Returns a String representation
 

Method Detail

getVersion

public java.lang.String getVersion()
Returns the version number of the assertion.

Returns:
The version number of the assertion.

setVersion

public void setVersion(java.lang.String version)
                throws SAML2Exception
Sets the version number of the assertion.

Parameters:
version - the version number.
Throws:
SAML2Exception - if the object is immutable

getIssueInstant

public java.util.Date getIssueInstant()
Returns the time when the assertion was issued

Returns:
the time of the assertion issued

setIssueInstant

public void setIssueInstant(java.util.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

public Subject getSubject()
Returns the subject of the assertion

Returns:
the subject of the assertion

setSubject

public 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

public Advice getAdvice()
Returns the advice of the assertion

Returns:
the advice of the assertion

setAdvice

public 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

public java.lang.String getSignature()
Returns the signature of the assertion

Returns:
the signature of the assertion

getConditions

public Conditions getConditions()
Returns the conditions of the assertion

Returns:
the conditions of the assertion

setConditions

public 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

public java.lang.String getID()
Returns the id of the assertion

Returns:
the id of the assertion

setID

public void setID(java.lang.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

public java.util.List getStatements()
Returns the statements of the assertion

Returns:
the statements of the assertion

getAuthnStatements

public java.util.List getAuthnStatements()
Returns the AuthnStatements of the assertion

Returns:
the AuthnStatements of the assertion

getAuthzDecisionStatements

public java.util.List getAuthzDecisionStatements()
Returns the AuthzDecisionStatements of the assertion

Returns:
the AuthzDecisionStatements of the assertion

getAttributeStatements

public java.util.List getAttributeStatements()
Returns the attribute statements of the assertion

Returns:
the attribute statements of the assertion

setStatements

public void setStatements(java.util.List statements)
                   throws SAML2Exception
Sets the statements of the assertion

Parameters:
statements - the statements of the assertion
Throws:
SAML2Exception - if the object is immutable

setAuthnStatements

public void setAuthnStatements(java.util.List statements)
                        throws SAML2Exception
Sets the AuthnStatements of the assertion

Parameters:
statements - the AuthnStatements of the assertion
Throws:
SAML2Exception - if the object is immutable

setAuthzDecisionStatements

public void setAuthzDecisionStatements(java.util.List statements)
                                throws SAML2Exception
Sets the AuthzDecisionStatements of the assertion

Parameters:
statements - the AuthzDecisionStatements of the assertion
Throws:
SAML2Exception - if the object is immutable

setAttributeStatements

public void setAttributeStatements(java.util.List 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

public Issuer getIssuer()
Returns the issuer of the assertion

Returns:
the issuer of the assertion

setIssuer

public 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

public boolean isSigned()
Return true if the assertion is signed

Returns:
true if the assertion is signed

isSignatureValid

public boolean isSignatureValid(java.security.cert.X509Certificate senderCert)
                         throws SAML2Exception
Return whether the signature is valid or not.

Parameters:
senderCert - Certificate containing the public key 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

public 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

public void sign(java.security.PrivateKey privateKey,
                 java.security.cert.X509Certificate cert)
          throws SAML2Exception
Signs the Assertion.

Parameters:
privateKey - Signing key
cert - Certificate which contain the public key correlated to the signing key; It if is not null, then the signature will include the certificate; Otherwise, the signature will not include any certificate
Throws:
SAML2Exception - if it could not sign the assertion.

encrypt

public EncryptedAssertion encrypt(java.security.Key recipientPublicKey,
                                  java.lang.String dataEncAlgorithm,
                                  int dataEncStrength,
                                  java.lang.String recipientEntityID)
                           throws SAML2Exception
Returns an EncryptedAssertion object.

Parameters:
recipientPublicKey - Public key used to encrypt the data encryption (secret) key, it is the public key of the recipient of the XML document to be encrypted.
dataEncAlgorithm - Data encryption algorithm.
dataEncStrength - Data encryption strength.
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.

toXMLString

public java.lang.String toXMLString(boolean includeNSPrefix,
                                    boolean declareNS)
                             throws SAML2Exception
Returns a String representation

Parameters:
includeNSPrefix - Determines whether or not the namespace qualifier is prepended to the Element when converted
declareNS - Determines whether or not the namespace is declared within the Element.
Returns:
A String representation
Throws:
SAML2Exception - if something is wrong during conversion

toXMLString

public java.lang.String toXMLString()
                             throws SAML2Exception
Returns a String representation

Returns:
A String representation
Throws:
SAML2Exception - if something is wrong during conversion

makeImmutable

public void makeImmutable()
Makes the object immutable


isMutable

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

Returns:
true if the object is mutable


Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.