|
|||||||||
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 informationpublic 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 informationpublic SAMLAssertion(Element e) throws SAMLException
e
- The root of a DOM tree
SAMLException
- Thrown if the object cannot be constructedpublic 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 SAMLSignedObject
SAMLException
- Thrown if an error occurs while placing the signaturepublic void fromDOM(Element e) throws SAMLException
SAMLObject
fromDOM
in class SAMLSignedObject
e
- 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 SAMLSignedObject
public 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 invalidpublic void addCondition(SAMLCondition c) throws SAMLException
c
- The condition to add
SAMLException
- Raised if an error occurs while adding the conditionpublic void removeCondition(int index) throws IndexOutOfBoundsException
index
- The position of the condition to remove
IndexOutOfBoundsException
public 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 objectspublic void addAdvice(Object advice) throws SAMLException
data
- a String, SAMLAssertion, or DOM Element
SAMLException
- Raised if object is invalidpublic void removeAdvice(int index) throws IndexOutOfBoundsException
index
- The position of the element to remove
IndexOutOfBoundsException
public 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 objectspublic void addStatement(SAMLStatement s) throws SAMLException
s
- The statement to add
SAMLException
- Raised if an error occurs while adding the statementpublic 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 SAMLObject
doc
- 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 SAMLObject
doc
- 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 SAMLObject
SAMLException
- Raised if the serialized object would be invalid SAML,
excluding any embedded objectsSAMLObject.checkValidity()
public Object clone() throws CloneNotSupportedException
clone
in class SAMLSignedObject
CloneNotSupportedException
Object.clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |