public class Assertion extends XMLElement
| Modifier and Type | Field and Description | 
|---|---|
protected static java.lang.String | 
VERSION  | 
| Modifier | Constructor and Description | 
|---|---|
  | 
Assertion(org.w3c.dom.Document owner)
Creates a new  
Assertion instance. | 
protected | 
Assertion(org.w3c.dom.Document owner, java.lang.String nsURI, java.lang.String localName)
Creates a new  
Assertion instance. | 
  | 
Assertion(org.w3c.dom.Element element)
Creates a new  
Assertion instance from the given Element node. | 
  | 
Assertion(org.w3c.dom.Element element, java.lang.String systemId)
Creates a new  
Assertion instance from the given Element node. | 
| Modifier and Type | Method and Description | 
|---|---|
XSSignature | 
addSignature(java.lang.String signatureMethod, java.lang.String c14nMethod)
Creates a new XML-DSIG  
Signature element and inserts it into this message, replacing any exisiting XML-DSIG Signature element. | 
XSSignature | 
addSignature(java.lang.String signatureMethod, java.lang.String c14nMethod, java.lang.String digestMethod)
Creates a new XML-DSIG  
Signature element and inserts it into this message, replacing any exisiting XML-DSIG Signature element. | 
void | 
addStatement(Statement statement)
Adds a Statement element to this assertion. 
 | 
protected void | 
clearSignature()
Removes any exisiting XML-DSIG Signature elements from this message. 
 | 
Advice | 
getAdvice()
Returns additional information for processing this assertion. 
 | 
java.util.List | 
getAttributeStatements()
Returns a  
List containing the AttributeStatement elements present in this assertion. | 
java.util.List | 
getAuthnStatements()
Returns a  
List containing the AuthnStatement elements present in this assertion. | 
java.util.List | 
getAuthzDecisionStatements()
Returns a  
List containing the AuthzDecisionStatement elements present in this assertion. | 
Conditions | 
getConditions()
Returns the conditions associated with this assertion. 
 | 
java.lang.String | 
getID()
Returns the identifier attribute for this  
Assertion. | 
java.util.Date | 
getIssueInstant()
Returns the time instant of issuance of this assertion. 
 | 
Issuer | 
getIssuer()
Returns the name of the issuer  
Assertion. | 
XSSignature | 
getSignature()
Returns the XML Signature child element from this  
SAMLMessage element. | 
Subject | 
getSubject()
Returns the subject of this assertion. 
 | 
java.lang.String | 
getVersion()
Returns the version of this  
Assertion message. | 
boolean | 
isSigned()
Indicates if this element was signed. 
 | 
void | 
setAdvice(Advice advice)
Sets the additional advice that should be considered when validating this assertion. 
 | 
void | 
setConditions(Conditions conditions)
Sets the conditions that must be taken into account when validating this assertion. 
 | 
void | 
setID(java.lang.String assertionID)
Sets the identifier attribute for this  
Assertion object. | 
void | 
setIssueInstant(java.util.Date issueInstant)
Sets the time instant of issuance of this assertion in UTC time. 
 | 
void | 
setIssuer(NameID issuer)
Sets the issuer of this  
Assertion. | 
void | 
setSubject(Subject subject)
Sets the Subject of this assertion. 
 | 
void | 
setVersion(java.lang.String ver)
Sets the Version of this  
Assertion message. | 
void | 
sign(java.security.PrivateKey privateKey, java.security.cert.X509Certificate cert)
Signs this  
SAMLMessage with the given private key, and includes the given certificate in the KeyInfo child element of the resulting XML-DSIG Signature element. | 
void | 
sign(java.security.PrivateKey privateKey, java.security.cert.X509Certificate cert, java.lang.String c14nMethod)
Signs this  
SAMLMessage with the given private key, and includes the given certificate in the KeyInfo child element of the resulting XML-DSIG Signature element. | 
boolean | 
verify()
Verifies the signature using a key obtained either from the KeyInfo element (if any is present) or via the  
oracle.security.xmlsec.keys.retrieval.KeyRetriever mechanism. | 
boolean | 
verify(java.security.PublicKey publicKey)
Verifies the signature with the given public key. 
 | 
addNSPrefixAttr, addNSPrefixAttr, addNSPrefixAttrDefault, addNSPrefixAttrDefault, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildElementsByTagName, getChildElementsByTagName, getChildElementsByTagNameNS, getChildElementsByTagNameNS, getDefaultNSPrefix, getElement, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setDefaultNSPrefixappendChild, appendChild, appendTo, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSystemId, hasAttributes, hasChildNodes, insertBefore, insertBefore, isSupported, normalize, removeChild, removeChild, replaceChild, replaceChild, setNodeValue, setPrefix, setSystemId, toBytesXML, toStringXML
public Assertion(org.w3c.dom.Element element)
          throws org.w3c.dom.DOMException
Assertion instance from the given Element node.element - An Assertion element.org.w3c.dom.DOMException
public Assertion(org.w3c.dom.Element element,
                 java.lang.String systemId)
          throws org.w3c.dom.DOMException
Assertion instance from the given Element node.element - An Assertion element.systemId - The URI string system ID for the Assertion.org.w3c.dom.DOMException
public Assertion(org.w3c.dom.Document owner)
          throws org.w3c.dom.DOMException
Assertion instance.owner - The owner document of the new Assertion.org.w3c.dom.DOMException
protected Assertion(org.w3c.dom.Document owner,
                    java.lang.String nsURI,
                    java.lang.String localName)
             throws org.w3c.dom.DOMException
Assertion instance. This constructor is for use in subclass for extension of the Assertion element.owner - The owner document of the new Assertion.nsURI - The namespace URI in which the new Assertion is to be created.localName - The localName of the element represented by the class that extends this class.org.w3c.dom.DOMExceptionpublic void setVersion(java.lang.String ver)
Assertion message.ver - The version number String.public java.lang.String getVersion()
Assertion message.null if none has been set.public void setID(java.lang.String assertionID)
Assertion object.assertionID - A unique String value.public java.lang.String getID()
Assertion.null if none has been set.public void setIssueInstant(java.util.Date issueInstant)
issueInstant - The Date object representing the issue time.public java.util.Date getIssueInstant()
Date object representing the issue time or null if none has been set.public void setIssuer(NameID issuer)
Assertion.issuer - The name of the issuer.public Issuer getIssuer()
Assertion.null if none has been set.public void setSubject(Subject subject)
subject - A Subject object.public Subject getSubject()
Subject object or null if none has been set.public void setConditions(Conditions conditions)
conditions - A Conditions object containing a collection of condition's.public Conditions getConditions()
Conditions object containing a set of Condition objects or null if none has been set.public void setAdvice(Advice advice)
advice - An Advice object that contains additional information for this assertion.public Advice getAdvice()
Advice object or null if none has been set.public void addStatement(Statement statement)
statement - The Statement to add.public java.util.List getAuthnStatements()
List containing the AuthnStatement elements present in this assertion.List object of AuthnStatement objects or an empty List.public java.util.List getAuthzDecisionStatements()
List containing the AuthzDecisionStatement elements present in this assertion.List object of AuthzDecisionStatement objects or an empty List.public java.util.List getAttributeStatements()
List containing the AttributeStatement elements present in this assertion.List object of AttributeStatement objects or an empty List.public XSSignature getSignature()
SAMLMessage element.XSSignature object or null if no signature is present.public boolean isSigned()
true if a signature is present, false otherwise.
public void sign(java.security.PrivateKey privateKey,
                 java.security.cert.X509Certificate cert)
          throws SigningException
SAMLMessage with the given private key, and includes the given certificate in the KeyInfo child element of the resulting XML-DSIG Signature element. The default canonicalization method is XML-EXCLUSIVE-C14N.privateKey - The private key to use for the signature computation.cert - The X509 certificate corresponding to the private key.SigningException
public void sign(java.security.PrivateKey privateKey,
                 java.security.cert.X509Certificate cert,
                 java.lang.String c14nMethod)
          throws SigningException
SAMLMessage with the given private key, and includes the given certificate in the KeyInfo child element of the resulting XML-DSIG Signature element.privateKey - The private key to use for the signature computation.cert - The X509 certificate corresponding to the private key.c14nMethod - The URI identifying the canonicalization method to be applied to the SignedInfo structure.SigningExceptionpublic XSSignature addSignature(java.lang.String signatureMethod, java.lang.String c14nMethod)
Signature element and inserts it into this message, replacing any exisiting XML-DSIG Signature element. The default message digest algorithm is SHA-1.
Note: This method does not compute the SignatureValue or create a KeyInfo child element for the Signature element so, at a minimum, one of the sign() methods must be invoked on the returned XSSignature object.
This method is intended for use by developers who need to customize the Signature element (e.g., add custom Transform elements) the computation of the SignatureValue (e.g., using an HMAC signature algorithm) or the KeyInfo element. For most developers, either the #sign(PrivateKey, X509) or #sign(PrivateKey, X509, String) method should be sufficient.
If the ID attribute is not set, the entire document will be signed and a XPath Transform will be added to ensure that only the saml:Assertion element is signed.
signatureMethod - The value of the Algorithm attribute of the SignatureMethod element contained within the new Signature element's SignedInfo child element (e.g., oracle.security.xmlsec.util.XMLURI.alg_rsaWithSHA1).c14nMethod - The value of the Algorithm attribute of the CanonicalizationMethod element contained within the new Signature element's SignedInfo child element (e.g., oracle.security.xmlsec.util.XMLURI.alg_c14nWithComments).oracle.security.xmlsec.dsig.XSSignature object.public XSSignature addSignature(java.lang.String signatureMethod, java.lang.String c14nMethod, java.lang.String digestMethod)
Signature element and inserts it into this message, replacing any exisiting XML-DSIG Signature element.
Note: This method does not compute the SignatureValue or create a KeyInfo child element for the Signature element so, at a minimum, one of the sign() methods must be invoked on the returned XSSignature object.
This method is intended for use by developers who need to customize the Signature element (e.g., add custom Transform elements) the computation of the SignatureValue (e.g., using an HMAC signature algorithm) or the KeyInfo element. For most developers, either the #sign(PrivateKey, X509) or #sign(PrivateKey, X509, String) method should be sufficient.
If the ID attribute is not set, the entire document will be signed and a XPath Transform will be added to ensure that only the saml:Assertion element is signed.
signatureMethod - The value of the Algorithm attribute of the SignatureMethod element contained within the new Signature element's SignedInfo child element (e.g., oracle.security.xmlsec.util.XMLURI.alg_rsaWithSHA1).c14nMethod - The value of the Algorithm attribute of the CanonicalizationMethod element contained within the new Signature element's SignedInfo child element (e.g., oracle.security.xmlsec.util.XMLURI.alg_c14nWithComments).digestMethod - The value of the Algorithm attribute of the DigestMethod element contained within the new Signature element's Reference child element (e.g., oracle.security.xmlsec.util.XMLURI.alg_sha1).oracle.security.xmlsec.dsig.XSSignature object.
public boolean verify()
               throws VerifyException
oracle.security.xmlsec.keys.retrieval.KeyRetriever mechanism. Any Manifests referenced by the signature will be validated.true if the verification succeeded, or false if the verification failed.VerifyException - If an error occurs while verifying the signature, or if no signature is present in this message.
public boolean verify(java.security.PublicKey publicKey)
               throws VerifyException
publicKey - The public key used for verifying the signature.true if the verification succeeded, or false if the verification failed.VerifyException - If an error occurs while verifying the signature, or if no signature is present in this message.protected void clearSignature()