com.sun.identity.federation.message
Class FSAssertion

java.lang.Object
  extended bycom.sun.identity.saml.assertion.Assertion
      extended bycom.sun.identity.federation.message.FSAssertion

public class FSAssertion
extends Assertion

The class FSAssertion creates and parses Liberty Assertion during the Single Sign-On process. This class extends from SAML Assertion.


Constructor Summary
FSAssertion(org.w3c.dom.Element assertionElement)
          Constructor to create an FSAssertion from the DOM Element
FSAssertion(java.lang.String assertionID, java.lang.String issuer, java.util.Date issueInstant, Conditions conditions, Advice advice, java.util.Set statements, java.lang.String inResponseTo)
          Constructor to create an FSAssertion
FSAssertion(java.lang.String assertionID, java.lang.String issuer, java.util.Date issueInstant, Conditions conditions, java.util.Set statements, java.lang.String inResponseTo)
          Constructor to create an FSAssertion
FSAssertion(java.lang.String assertionID, java.lang.String issuer, java.util.Date issueInstant, java.util.Set statements, java.lang.String inResponseTo)
          Constructor to create an FSAssertion
 
Method Summary
 boolean addStatement(Statement statement)
          Adds a statement to this Assertion.
 java.util.List getDiscoveryCredential()
          Gets the discovery service credentials from the boot strap.
 org.w3c.dom.Element getDOMElement()
          Gets original DOM Element used to construct the Assertion.
 java.lang.String getID()
          Gets id attribute, this applies to ID-FF 1.1 only.
 java.lang.String getInResponseTo()
          Gets inResponseTo attribute.
 int getMinorVersion()
          Gets minor version attribute.
 java.lang.String getSignatureString()
          Gets XML Signature Element as String.
 java.lang.String getSignedXMLString()
          Gets signed Assertion as XML String.
 boolean isTimeValid()
          Gets the validity of the assertion evaluating its conditions if specified.
 void setID(java.lang.String id)
          Sets id attribute, this applies to ID-FF 1.1 only.
 void setInResponseTo(java.lang.String inResponseTo)
          Sets inResponseTo attribute.
 void setMinorVersion(int version)
          Sets minor version attribute.
 boolean setSignature(org.w3c.dom.Element elem)
          Sets the Signature element
 void signXML(java.lang.String certAlias)
          Signs the Assertion.
 java.lang.String toXMLString()
          Gets XML string representation of the Assertion.
 java.lang.String toXMLString(boolean includeNS, boolean declareNS)
          Gets XML string representation of the Assertion.
 
Methods inherited from class com.sun.identity.saml.assertion.Assertion
getAdvice, getAssertionID, getConditions, getIssueInstant, getIssuer, getMajorVersion, getSignature, getStatement, isSignatureValid, isSigned, setAdvice, setConditions, setMajorVersion, signXML, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FSAssertion

public FSAssertion(org.w3c.dom.Element assertionElement)
            throws FSMsgException,
                   SAMLException
Constructor to create an FSAssertion from the DOM Element

Parameters:
assertionElement - Assertion Element
Throws:
FSMsgException - for Federation processing fail
SAMLException - for SAML Assertion processing fail

FSAssertion

public FSAssertion(java.lang.String assertionID,
                   java.lang.String issuer,
                   java.util.Date issueInstant,
                   java.util.Set statements,
                   java.lang.String inResponseTo)
            throws FSMsgException,
                   SAMLException
Constructor to create an FSAssertion

Parameters:
assertionID - Assertion ID
issuer - Assertion Issuer
issueInstant - Issue Date Instant
statements - List of statements that need to be added in assertion.
inResponseTo - In Response To RequestID
Throws:
SAMLException - if unable to construct the object
FSMsgException - if unable to construct the object

FSAssertion

public FSAssertion(java.lang.String assertionID,
                   java.lang.String issuer,
                   java.util.Date issueInstant,
                   Conditions conditions,
                   java.util.Set statements,
                   java.lang.String inResponseTo)
            throws FSMsgException,
                   SAMLException
Constructor to create an FSAssertion

Parameters:
assertionID - Assertion ID
issuer - Assertion Issuer
issueInstant - Issue Date Instant
conditions - Conditions
statements - List of statements that need to be added in assertion.
inResponseTo - In Response To RequestID
Throws:
FSMsgException - if unable to construct the object
SAMLException - if unable to construct the object

FSAssertion

public FSAssertion(java.lang.String assertionID,
                   java.lang.String issuer,
                   java.util.Date issueInstant,
                   Conditions conditions,
                   Advice advice,
                   java.util.Set statements,
                   java.lang.String inResponseTo)
            throws FSMsgException,
                   SAMLException
Constructor to create an FSAssertion

Parameters:
assertionID - Assertion ID
issuer - Assertion Issuer
issueInstant - Issue Date Instant
conditions - Conditions
advice - Advice
statements - List of statements that need to be added in assertion.
inResponseTo - In Response To RequestID
Throws:
SAMLException - if unable to construct the object
FSMsgException - if unable to construct the object
Method Detail

getID

public java.lang.String getID()
Gets id attribute, this applies to ID-FF 1.1 only.

Returns:
id attribute.

setID

public void setID(java.lang.String id)
Sets id attribute, this applies to ID-FF 1.1 only.

Parameters:
id - attribute to be set.

getMinorVersion

public int getMinorVersion()
Gets minor version attribute.

Overrides:
getMinorVersion in class Assertion
Returns:
minor version.

setMinorVersion

public void setMinorVersion(int version)
Sets minor version attribute.

Overrides:
setMinorVersion in class Assertion
Parameters:
version - minor version to be set.

getDOMElement

public org.w3c.dom.Element getDOMElement()
Gets original DOM Element used to construct the Assertion.

Returns:
DOM Element, null if the object is not constructed from a DOM element

getInResponseTo

public java.lang.String getInResponseTo()
Gets inResponseTo attribute.

Returns:
inResponseTo attribute.

setInResponseTo

public void setInResponseTo(java.lang.String inResponseTo)
Sets inResponseTo attribute.

Parameters:
inResponseTo - attribute to be set.

getSignedXMLString

public java.lang.String getSignedXMLString()
Gets signed Assertion as XML String.

Returns:
XML String, null if the FSAssertion is not signed.

getSignatureString

public java.lang.String getSignatureString()
Gets XML Signature Element as String.

Returns:
XML digital signature element, null if the FSAssertion is not signed.

isTimeValid

public boolean isTimeValid()
Gets the validity of the assertion evaluating its conditions if specified.

Overrides:
isTimeValid in class Assertion
Returns:
false if conditions is invalid when lying between NotBefore (current time inclusive) and NotOnOrAfter (current time exclusive) values and true otherwise or if no conditions specified.

addStatement

public boolean addStatement(Statement statement)
Adds a statement to this Assertion.

Overrides:
addStatement in class Assertion
Parameters:
statement - Statement to be added
Returns:
true if success, false otherwise.

toXMLString

public java.lang.String toXMLString()
                             throws FSMsgException
Gets XML string representation of the Assertion.

Returns:
XML string
Throws:
FSMsgException - if unable to convert to XML string

toXMLString

public java.lang.String toXMLString(boolean includeNS,
                                    boolean declareNS)
                             throws FSMsgException
Gets XML string representation of the Assertion.

Parameters:
includeNS - include namespace prefix if true.
declareNS - include namespace definition if true.
Returns:
XML string
Throws:
FSMsgException - if unable to convert to XML string

signXML

public void signXML(java.lang.String certAlias)
             throws SAMLException
Signs the Assertion.

Overrides:
signXML in class Assertion
Parameters:
certAlias - certification Alias used to sign Assertion.
Throws:
SAMLException - if unable to sign the Assertion.

setSignature

public boolean setSignature(org.w3c.dom.Element elem)
Sets the Signature element

Overrides:
setSignature in class Assertion
Parameters:
elem - Signature element to be set.
Returns:
true if successful, false otherwise.

getDiscoveryCredential

public java.util.List getDiscoveryCredential()
Gets the discovery service credentials from the boot strap.

Returns:
List of com.sun.identity.liberty.ws.security.SecurityAssertion objects


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