|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensaml.SAMLObject
org.opensaml.SAMLSignedObject
org.opensaml.SAMLAssertion
public class SAMLAssertion
Represents a SAML Assertion
| Field Summary | |
|---|---|
protected ArrayList |
advice
|
protected String |
assertionId
|
protected ArrayList |
conditions
|
protected Date |
issueInstant
|
protected String |
issuer
|
protected int |
minor
|
protected Date |
notBefore
|
protected Date |
notOnOrAfter
|
protected ArrayList |
statements
|
| Fields inherited from class org.opensaml.SAMLObject |
|---|
config, dirty, log, parentObject, root |
| Constructor Summary | |
|---|---|
SAMLAssertion()
Default constructor |
|
SAMLAssertion(Element e)
Reconstructs an assertion from a DOM tree |
|
SAMLAssertion(InputStream in)
Reconstructs an assertion from a stream |
|
SAMLAssertion(InputStream in,
int minor)
Reconstructs an assertion of a particular minor version from a stream |
|
SAMLAssertion(String issuer,
Date notBefore,
Date notOnOrAfter,
Collection conditions,
Collection advice,
Collection statements)
Builds an assertion out of its component parts |
|
SAMLAssertion(String assertionId,
Date issueInstant,
String issuer,
Date notBefore,
Date notOnOrAfter,
Collection conditions,
Collection advice,
Collection statements)
Builds an assertion out of its component parts |
|
| Method Summary | |
|---|---|
void |
addAdvice(Object advice)
Adds an advice element |
void |
addCondition(SAMLCondition c)
Adds a condition to the assertion |
void |
addStatement(SAMLStatement s)
Adds a statement to the assertion |
protected Element |
buildRoot(Document doc,
boolean xmlns)
Delegates the process of building the root element of an object and inserting appropriate namespaces. |
void |
checkValidity()
Evaluates the object's content to see if it is currently valid if serialized. |
Object |
clone()
Copies a SAML object such that no dependencies exist between the original and the copy |
void |
fromDOM(Element e)
Initialization of an object from a DOM element |
Iterator |
getAdvice()
Gets the optional Advice data included in the assertion Advice can be Strings (assertion references), Assertions, or DOM Elements. |
Iterator |
getConditions()
Gets the conditions included in the assertion |
String |
getId()
Gets the assertion ID from the assertion |
Date |
getIssueInstant()
Gets the issue timestamp of the assertion |
String |
getIssuer()
Gets the issuer of the assertion |
int |
getMinorVersion()
Gets the MinorVersion of the assertion. |
Date |
getNotBefore()
Gets the start of the assertion's validity period |
Date |
getNotOnOrAfter()
Gets the end of the assertion's validity period |
Iterator |
getStatements()
Gets the statements included in the assertion |
protected void |
insertSignature()
Places the signature into the object's DOM to prepare for signing |
void |
removeAdvice(int index)
Removes an advice element by position (zero-based) |
void |
removeCondition(int index)
Removes a condition by position (zero-based) |
void |
removeStatement(int index)
Removes a statement by position (zero-based) |
void |
setAdvice(Collection advice)
Sets the optional Advice data to include in the assertion |
void |
setConditions(Collection conditions)
Sets the conditions included in the assertion |
void |
setId(String id)
Sets the assertion ID NOTE: Use this method with caution. |
void |
setIssueInstant(Date issueInstant)
Sets the issue timestamp of the assertion |
void |
setIssuer(String issuer)
Sets the issuer name |
void |
setMinorVersion(int minor)
Sets the MinorVersion of the assertion |
void |
setNotBefore(Date notBefore)
Sets the start of the assertion's validity period |
void |
setNotOnOrAfter(Date notOnOrAfter)
Sets the end of the assertion's validity period |
void |
setStatements(Collection statements)
Sets the statements to include in the assertion |
Node |
toDOM(Document doc,
boolean xmlns)
Transforms the object into a DOM tree using an existing document context |
| Methods inherited from class org.opensaml.SAMLSignedObject |
|---|
getDigestAlgorithm, getNativeSignature, getSignatureAlgorithm, getSignatureElement, getX509Certificates, isSigned, setDirty, sign, sign, toDOM, unsign, verify, verify, verify |
| Methods inherited from class org.opensaml.SAMLObject |
|---|
fromStream, fromStream, getParent, plantRoot, setParent, toBase64, toDOM, toDOM, toStream, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int minor
protected String assertionId
protected String issuer
protected Date issueInstant
protected Date notBefore
protected Date notOnOrAfter
protected ArrayList conditions
protected ArrayList advice
protected ArrayList statements
| Constructor Detail |
|---|
public SAMLAssertion()
public SAMLAssertion(String issuer,
Date notBefore,
Date notOnOrAfter,
Collection conditions,
Collection advice,
Collection statements)
throws SAMLException
issuer - Name of SAML authority issuing assertionnotBefore - Optional start of validitynotOnOrAfter - Optional end of validityconditions - Set of conditions on validityadvice - Optional advice contentstatements - Set of SAML statements to place in assertion
SAMLException - Raised if an assertion cannot be constructed
from the supplied information
public SAMLAssertion(String assertionId,
Date issueInstant,
String issuer,
Date notBefore,
Date notOnOrAfter,
Collection conditions,
Collection advice,
Collection statements)
throws SAMLException
assertionId - Unique identifier for assertionissueInstant - Time of issuanceissuer - Name of SAML authority issuing assertionnotBefore - Optional start of validitynotOnOrAfter - Optional end of validityconditions - Set of conditions on validityadvice - Optional advice contentstatements - Set of SAML statements to place in assertion
SAMLException - Raised if an assertion cannot be constructed
from the supplied information
public SAMLAssertion(Element e)
throws SAMLException
e - The root of a DOM tree
SAMLException - Thrown if the object cannot be constructed
public SAMLAssertion(InputStream in)
throws SAMLException
in - A stream containing XML
SAMLException - Raised if an exception occurs while constructing
the object.
public SAMLAssertion(InputStream in,
int minor)
throws SAMLException
in - A stream containing XMLminor - The minor version of the incoming assertion
SAMLException - Raised if an exception occurs while constructing
the object.| Method Detail |
|---|
protected void insertSignature()
throws SAMLException
insertSignature in class SAMLSignedObjectSAMLException - Thrown if an error occurs while placing the signature
public void fromDOM(Element e)
throws SAMLException
SAMLObject
fromDOM in class SAMLSignedObjecte - Root element of a DOM tree
SAMLException - Raised if an exception occurs while constructing
the objectSAMLObject.fromDOM(org.w3c.dom.Element)public int getMinorVersion()
public void setMinorVersion(int minor)
minor - The minor versionpublic String getId()
getId in class SAMLSignedObjectpublic void setId(String id)
id - The assertion IDpublic String getIssuer()
public void setIssuer(String issuer)
issuer - The issuer namepublic Date getIssueInstant()
public void setIssueInstant(Date issueInstant)
issueInstant - The issue timestamppublic Date getNotBefore()
public void setNotBefore(Date notBefore)
notBefore - The starting validity date and timepublic Date getNotOnOrAfter()
public void setNotOnOrAfter(Date notOnOrAfter)
notOnOrAfter - The ending validity date and timepublic Iterator getConditions()
public void setConditions(Collection conditions)
throws SAMLException
conditions - The conditions to include in the assertion
SAMLException - Raised if any of the conditions are invalid
public void addCondition(SAMLCondition c)
throws SAMLException
c - The condition to add
SAMLException - Raised if an error occurs while adding the condition
public void removeCondition(int index)
throws IndexOutOfBoundsException
index - The position of the condition to remove
IndexOutOfBoundsExceptionpublic Iterator getAdvice()
public void setAdvice(Collection advice)
throws SAMLException
advice - The Advice to include in the assertion
SAMLException - Raised if unable to construct new Advice objects
public void addAdvice(Object advice)
throws SAMLException
data - a String, SAMLAssertion, or DOM Element
SAMLException - Raised if object is invalid
public void removeAdvice(int index)
throws IndexOutOfBoundsException
index - The position of the element to remove
IndexOutOfBoundsExceptionpublic Iterator getStatements()
public void setStatements(Collection statements)
throws SAMLException
statements - The statements to include in the assertion
SAMLException - Raised if unable to construct new statement objects
public void addStatement(SAMLStatement s)
throws SAMLException
s - The statement to add
SAMLException - Raised if an error occurs while adding the statement
public void removeStatement(int index)
throws IndexOutOfBoundsException
index - The position of the statement to remove
IndexOutOfBoundsException
protected Element buildRoot(Document doc,
boolean xmlns)
SAMLObject
buildRoot in class SAMLObjectdoc - The document context to usexmlns - Include namespace(s) on root element?
SAMLObject.buildRoot(org.w3c.dom.Document,boolean)
public Node toDOM(Document doc,
boolean xmlns)
throws SAMLException
SAMLObject
toDOM in class SAMLObjectdoc - A Document object to use in manufacturing the treexmlns - Include namespace(s) on root element?
SAMLException - Raised if the object is incompletely definedSAMLObject.toDOM(org.w3c.dom.Document,boolean)
public void checkValidity()
throws SAMLException
SAMLObject
checkValidity in class SAMLObjectSAMLException - Raised if the serialized object would be invalid SAML,
excluding any embedded objectsSAMLObject.checkValidity()
public Object clone()
throws CloneNotSupportedException
clone in class SAMLSignedObjectCloneNotSupportedExceptionObject.clone()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||