org.opensaml
Class SAMLAssertion

java.lang.Object
  |
  +--org.opensaml.SAMLObject
        |
        +--org.opensaml.SAMLSignedObject
              |
              +--org.opensaml.SAMLAssertion
All Implemented Interfaces:
java.lang.Cloneable

public class SAMLAssertion
extends SAMLSignedObject
implements java.lang.Cloneable

Represents a SAML Assertion

Author:
Scott Cantor

Field Summary
 
Fields inherited from class org.opensaml.SAMLObject
config, log, root
 
Constructor Summary
SAMLAssertion(org.w3c.dom.Element e)
          Reconstructs an assertion from a DOM tree
SAMLAssertion(java.io.InputStream in)
          Reconstructs an assertion from a stream
SAMLAssertion(java.lang.String issuer, java.util.Date notBefore, java.util.Date notOnOrAfter, java.util.Collection conditions, SAMLAdvice advice, java.util.Collection statements)
          Builds an assertion out of its component parts
 
Method Summary
 java.lang.Object clone()
          Copies a SAML object such that no dependencies exist between the original and the copy
 void fromDOM(org.w3c.dom.Element e)
          Initialization of assertion from a DOM element.
 SAMLAdvice getAdvice()
          Gets the optional Advice data included in the assertion
 java.lang.String getAssertionID()
          Gets the assertion ID from the assertion
 java.util.Iterator getConditions()
          Gets the conditions included in the assertion
 java.lang.String getIssuer()
          Gets the issuer of the assertion
 java.util.Date getNotBefore()
          Gets the start of the assertion's validity period
 java.util.Date getNotOnOrAfter()
          Gets the end of the assertion's validity period
 java.util.Iterator getStatements()
          Gets the statements included in the assertion
protected  void insertSignature()
          Places the signature into the object's DOM to prepare for signing
 org.w3c.dom.Node toDOM(org.w3c.dom.Document doc)
          Overridden method to return a DOM tree representing the assertion
 
Methods inherited from class org.opensaml.SAMLSignedObject
getNativeSignature, getSignatureAlgorithm, getSignatureElement, getX509Certificates, isSigned, sign, toDOM, verify, verify, verify
 
Methods inherited from class org.opensaml.SAMLObject
fromStream, plantRoot, toBase64, toStream, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SAMLAssertion

public SAMLAssertion(java.lang.String issuer,
                     java.util.Date notBefore,
                     java.util.Date notOnOrAfter,
                     java.util.Collection conditions,
                     SAMLAdvice advice,
                     java.util.Collection statements)
              throws SAMLException
Builds an assertion out of its component parts

Parameters:
issuer - Name of SAML authority issuing assertion
notBefore - Optional start of validity
notOnOrAfter - Optional end of validity
conditions - Set of conditions on validity
advice - Optional advice content
statements - Set of SAML statements to place in assertion
Throws:
SAMLException - Raised if an assertion cannot be constructed from the supplied information

SAMLAssertion

public SAMLAssertion(org.w3c.dom.Element e)
              throws SAMLException
Reconstructs an assertion from a DOM tree

Parameters:
e - The root of a DOM tree
Throws:
SAMLException - Thrown if the object cannot be constructed

SAMLAssertion

public SAMLAssertion(java.io.InputStream in)
              throws SAMLException
Reconstructs an assertion from a stream

Parameters:
in - A stream containing XML
Throws:
SAMLException - Raised if an exception occurs while constructing the object.
Method Detail

insertSignature

protected void insertSignature()
                        throws SAMLException
Places the signature into the object's DOM to prepare for signing

Specified by:
insertSignature in class SAMLSignedObject
Throws:
SAMLException - Thrown if an error occurs while placing the signature

fromDOM

public void fromDOM(org.w3c.dom.Element e)
             throws SAMLException
Initialization of assertion from a DOM element.

Checks the assertion's syntactic validity. An exception is thrown if any problems are detected. The exception will contain a message describing the problem, and may wrap another exception.

Overrides:
fromDOM in class SAMLSignedObject
Parameters:
e - Root element of a DOM tree
Throws:
SAMLException - Raised if an exception occurs while constructing the object.

getAssertionID

public java.lang.String getAssertionID()
Gets the assertion ID from the assertion

Returns:
The assertion ID

getIssuer

public java.lang.String getIssuer()
Gets the issuer of the assertion

Returns:
The issuer name

getNotBefore

public java.util.Date getNotBefore()
Gets the start of the assertion's validity period

Returns:
The starting validity date and time

getNotOnOrAfter

public java.util.Date getNotOnOrAfter()
Gets the end of the assertion's validity period

Returns:
The ending validity date and time

getStatements

public java.util.Iterator getStatements()
Gets the statements included in the assertion

Returns:
An iterator of SAML statements

getAdvice

public SAMLAdvice getAdvice()
Gets the optional Advice data included in the assertion

Returns:
The Advice contained within the assertion

getConditions

public java.util.Iterator getConditions()
Gets the conditions included in the assertion

Returns:
An iterator of SAML conditions

toDOM

public org.w3c.dom.Node toDOM(org.w3c.dom.Document doc)
Overridden method to return a DOM tree representing the assertion

Overrides:
toDOM in class SAMLObject
Parameters:
doc - A Document object to use in manufacturing the tree
Returns:
Root "Assertion" element of a DOM tree

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Copies a SAML object such that no dependencies exist between the original and the copy

Overrides:
clone in class SAMLSignedObject
Returns:
The new object
java.lang.CloneNotSupportedException
See Also:
Object.clone()


Copyright © 2002 UCAID. All Rights Reserved.