Class SecurityAssertion
java.lang.Object
com.sun.identity.saml.assertion.AssertionBase
com.sun.identity.saml.assertion.Assertion
com.sun.identity.liberty.ws.security.SecurityAssertion
The
SecurityAssertion
class provides an extension to
Assertion
class to support ID-WSF
ResourceAccessStatement
and
SessionContextStatement
.-
Field Summary
Fields inherited from class com.sun.identity.saml.assertion.AssertionBase
_advice, _assertionID, _conditions, _issueInstant, _issuer, _majorVersion, _minorVersion, _statements, ASSERTION_ID_ATTRIBUTE, signature, signatureString, signed, validationDone, xmlString
-
Constructor Summary
ConstructorDescriptionSecurityAssertion
(String assertionID, String issuer, Date issueInstant, Conditions conditions, Advice advice, Set statements) ConstructsSecurityAssertion
object with theassertionID
, the issuer, time when assertion issued, the conditions when creating a new assertion,Advice
applicable to thisAssertion
and aSet
ofStatement
(s) in the assertion.SecurityAssertion
(String assertionID, String issuer, Date issueInstant, Conditions conditions, Set statements) ConstructsSecurityAssertion
object with theassertionID
, the issuer, time when assertion issued, the conditions when creating a new assertion and aSet
ofStatement
(s) in the assertion.SecurityAssertion
(String assertionID, String issuer, Date issueInstant, Set statements) ConstructsSecurityAssertion
object with theassertionID
, the issuer, time when assertion issued and aSet
ofStatement
(s) in the assertion.SecurityAssertion
(Element assertionElement) This constructor creates aSecurityAssertion
object from a DOM Element. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToParent
(Element headerE) Add theAssertion
to the Document Element.Determines if theSecurityAssertion
contains SAML Bearer confirmation method.protected int
protected int
boolean
isBearer()
Determines if theSecurityAssertion
contains SAML Bearer confirmation method.protected boolean
processUnknownElement
(Element element) toString()
Create a String representation of the element.toString
(boolean includeNS, boolean declareNS) Creates a String representation of the<Assertion>
element.Methods inherited from class com.sun.identity.saml.assertion.Assertion
createAdvice, createAssertionIDReference, createAssertionIDReference, createAttributeStatement, createAuthenticationStatement, createAuthorizationDecisionStatement, createConditions, getAdvice, parseAssertionElement, signXML
Methods inherited from class com.sun.identity.saml.assertion.AssertionBase
addStatement, getAssertionID, getConditions, getIssueInstant, getIssuer, getMajorVersion, getMinorVersion, getSignature, getStatement, isTimeValid, setAdvice, setAssertionID, setConditions, setIssueInstant, setIssuer, setMajorVersion, setMinorVersion, setSignature
-
Constructor Details
-
SecurityAssertion
This constructor creates aSecurityAssertion
object from a DOM Element.- Parameters:
assertionElement
- Aorg.w3c.dom.Element
representing DOM tree forAssertion
object- Throws:
SAMLException
- if it could not process the Element properly, implying that there is an error in the sender or in the element definition.
-
SecurityAssertion
public SecurityAssertion(String assertionID, String issuer, Date issueInstant, Set statements) throws SAMLException ConstructsSecurityAssertion
object with theassertionID
, the issuer, time when assertion issued and aSet
ofStatement
(s) in the assertion.- Parameters:
assertionID
-assertionID
attribute contained within thisAssertion
if null, anassertionID
is generated internally.issuer
- String representing the issuer of this assertion.issueInstant
- time instant of the issue. It has typedateTime
which is built in to the W3C XML Schema Types specification.if null, current time is used.statements
- Set ofStatement
objects within thisAssertion
. It could be of typeAuthenticationStatement
,AuthorizationDecisionStatement
andAttributeStatement
. Each Assertion can have multiple type of statements in it.- Throws:
SAMLException
- issuer is null or the size of statements is 0.
-
SecurityAssertion
public SecurityAssertion(String assertionID, String issuer, Date issueInstant, Conditions conditions, Set statements) throws SAMLException ConstructsSecurityAssertion
object with theassertionID
, the issuer, time when assertion issued, the conditions when creating a new assertion and aSet
ofStatement
(s) in the assertion.- Parameters:
assertionID
- String representingAssertionID
contained within thisAssertion
if null its generated internally.issuer
- String representing the issuer of this assertion.issueInstant
- time instant of the issue. It has typedateTime
which is built in to the W3C XML Schema Types specification. if null current time is used.conditions
-Conditions
under which the thisAssertion
is valid.statements
- Set ofStatement
objects within thisAssertion
. It could be of typeAuthenticationStatement
,AuthorizationDecisionStatement
andAttributeStatement
. Each Assertion can have multiple type of statements in it.- Throws:
SAMLException
- issuer is null or the size of statements is 0.
-
SecurityAssertion
public SecurityAssertion(String assertionID, String issuer, Date issueInstant, Conditions conditions, Advice advice, Set statements) throws SAMLException ConstructsSecurityAssertion
object with theassertionID
, the issuer, time when assertion issued, the conditions when creating a new assertion,Advice
applicable to thisAssertion
and aSet
ofStatement
(s) in the assertion.- Parameters:
assertionID
-AssertionID
object contained within thisAssertion
if null its generated internally.issuer
- String representing the issuer of this assertion.issueInstant
- time instant of the issue. It has typedateTime
which is built in to the W3C XML Schema Types specification. if null current time is used.conditions
-Conditions
under which the thisAssertion
is valid.advice
-Advice
applicable for thisAssertion
.statements
- Set ofStatement
objects within thisAssertion
. It could be of typeAuthenticationStatement
,AuthorizationDecisionStatement
andAttributeStatement
. Each Assertion can have multiple type of statements in it.- Throws:
SAMLException
- issuer is null or the size of statements is 0.
-
-
Method Details
-
isBearer
public boolean isBearer()Determines if theSecurityAssertion
contains SAML Bearer confirmation method.- Returns:
- true if the
SecurityAssertion
contains SAML Bearer confirmation.
-
getBearerSubject
Determines if theSecurityAssertion
contains SAML Bearer confirmation method. If it is, return its Subject. Otherwise, return null.- Returns:
- Subject if the
SecurityAssertion
contains SAML Bearer confirmation.
-
toString
Create a String representation of the element.- Overrides:
toString
in classAssertionBase
- Returns:
- A string containing the valid XML for this element.
By default name space name is prepended to the element name
example
<saml:Assertion>
.
-
toString
Creates a String representation of the<Assertion>
element.- Overrides:
toString
in classAssertionBase
- Parameters:
includeNS
- if true prepends all elements by their Namespace name example<saml:Assertion>
declareNS
- if true includes the namespace within the generated XML.- Returns:
- A string containing the valid XML for this element.
-
processUnknownElement
- Overrides:
processUnknownElement
in classAssertion
- Throws:
SAMLException
-
getMinAssertionMinorVersion
protected int getMinAssertionMinorVersion()- Overrides:
getMinAssertionMinorVersion
in classAssertion
-
getMaxAssertionMinorVersion
protected int getMaxAssertionMinorVersion()- Overrides:
getMaxAssertionMinorVersion
in classAssertion
-
addToParent
Add theAssertion
to the Document Element.- Parameters:
headerE
- the element to be updated.- Throws:
Exception
- if there is an error.
-