Class SecurityAssertion
- java.lang.Object
-
- com.sun.identity.saml.assertion.AssertionBase
-
- com.sun.identity.saml.assertion.Assertion
-
- com.sun.identity.liberty.ws.security.SecurityAssertion
-
public class SecurityAssertion extends Assertion
TheSecurityAssertionclass provides an extension toAssertionclass to supportID-WSFResourceAccessStatementandSessionContextStatement.
-
-
Field Summary
-
Fields inherited from class com.sun.identity.saml.assertion.AssertionBase
_advice, _assertionID, _conditions, _issueInstant, _issuer, _majorVersion, _minorVersion, _statements, ASSERTION_ID_ATTRIBUTE, sc, signature, signatureString, signed, valid, validationDone, xmlString
-
-
Constructor Summary
Constructors Constructor Description SecurityAssertion(String assertionID, String issuer, Date issueInstant, Conditions conditions, Advice advice, Set statements)ConstructsSecurityAssertionobject with theassertionID, the issuer, time when assertion issued, the conditions when creating a new assertion,Adviceapplicable to thisAssertionand aSetofStatement(s) in the assertion.SecurityAssertion(String assertionID, String issuer, Date issueInstant, Conditions conditions, Set statements)ConstructsSecurityAssertionobject with theassertionID, the issuer, time when assertion issued, the conditions when creating a new assertion and aSetofStatement(s) in the assertion.SecurityAssertion(String assertionID, String issuer, Date issueInstant, Set statements)ConstructsSecurityAssertionobject with theassertionID, the issuer, time when assertion issued and aSetofStatement(s) in the assertion.SecurityAssertion(Element assertionElement)This constructor creates aSecurityAssertionobject from a DOM Element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToParent(Element headerE)Add theAssertionto the Document Element.SubjectgetBearerSubject()Determines if theSecurityAssertioncontains SAML Bearer confirmation method.protected intgetMaxAssertionMinorVersion()protected intgetMinAssertionMinorVersion()booleanisBearer()Determines if theSecurityAssertioncontains SAML Bearer confirmation method.booleanisSignatureValid()Return whether the signature is valid.protected booleanprocessUnknownElement(Element element)voidsetVerifyingCertAlias(String certAlias)Sets the value of the certificate alias.StringtoString()Create a String representation of the element.StringtoString(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, signXML
-
Methods inherited from class com.sun.identity.saml.assertion.AssertionBase
addStatement, getAssertionID, getConditions, getIssueInstant, getIssuer, getMajorVersion, getMinorVersion, getSignature, getStatement, isSigned, isTimeValid, setAdvice, setAssertionID, setConditions, setIssueInstant, setIssuer, setMajorVersion, setMinorVersion, setSignature
-
-
-
-
Constructor Detail
-
SecurityAssertion
public SecurityAssertion(Element assertionElement) throws SAMLException
This constructor creates aSecurityAssertionobject from a DOM Element.- Parameters:
assertionElement- Aorg.w3c.dom.Elementrepresenting DOM tree forAssertionobject- 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
ConstructsSecurityAssertionobject with theassertionID, the issuer, time when assertion issued and aSetofStatement(s) in the assertion.- Parameters:
assertionID-assertionIDattribute contained within thisAssertionif null, anassertionIDis generated internally.issuer- String representing the issuer of this assertion.issueInstant- time instant of the issue. It has typedateTimewhich is built in to the W3C XML Schema Types specification.if null, current time is used.statements- Set ofStatementobjects within thisAssertion. It could be of typeAuthenticationStatement,AuthorizationDecisionStatementandAttributeStatement. 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
ConstructsSecurityAssertionobject with theassertionID, the issuer, time when assertion issued, the conditions when creating a new assertion and aSetofStatement(s) in the assertion.- Parameters:
assertionID- String representingAssertionIDcontained within thisAssertionif null its generated internally.issuer- String representing the issuer of this assertion.issueInstant- time instant of the issue. It has typedateTimewhich is built in to the W3C XML Schema Types specification. if null current time is used.conditions-Conditionsunder which the thisAssertionis valid.statements- Set ofStatementobjects within thisAssertion. It could be of typeAuthenticationStatement,AuthorizationDecisionStatementandAttributeStatement. 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
ConstructsSecurityAssertionobject with theassertionID, the issuer, time when assertion issued, the conditions when creating a new assertion,Adviceapplicable to thisAssertionand aSetofStatement(s) in the assertion.- Parameters:
assertionID-AssertionIDobject contained within thisAssertionif null its generated internally.issuer- String representing the issuer of this assertion.issueInstant- time instant of the issue. It has typedateTimewhich is built in to the W3C XML Schema Types specification. if null current time is used.conditions-Conditionsunder which the thisAssertionis valid.advice-Adviceapplicable for thisAssertion.statements- Set ofStatementobjects within thisAssertion. It could be of typeAuthenticationStatement,AuthorizationDecisionStatementandAttributeStatement. Each Assertion can have multiple type of statements in it.- Throws:
SAMLException- issuer is null or the size of statements is 0.
-
-
Method Detail
-
setVerifyingCertAlias
public void setVerifyingCertAlias(String certAlias)
Sets the value of the certificate alias.- Parameters:
certAlias- the certificate alias.
-
isSignatureValid
public boolean isSignatureValid()
Return whether the signature is valid.- Overrides:
isSignatureValidin classAssertion- Returns:
- true if the signature is valid.
-
isBearer
public boolean isBearer()
Determines if theSecurityAssertioncontains SAML Bearer confirmation method.- Returns:
- true if the
SecurityAssertioncontains SAML Bearer confirmation.
-
getBearerSubject
public Subject getBearerSubject()
Determines if theSecurityAssertioncontains SAML Bearer confirmation method. If it is, return its Subject. Otherwise, return null.- Returns:
- Subject if the
SecurityAssertioncontains SAML Bearer confirmation.
-
toString
public String toString()
Create a String representation of the element.- Overrides:
toStringin 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
public String toString(boolean includeNS, boolean declareNS)
Creates a String representation of the<Assertion>element.- Overrides:
toStringin 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
protected boolean processUnknownElement(Element element) throws SAMLException
- Overrides:
processUnknownElementin classAssertion- Throws:
SAMLException
-
getMinAssertionMinorVersion
protected int getMinAssertionMinorVersion()
- Overrides:
getMinAssertionMinorVersionin classAssertion
-
getMaxAssertionMinorVersion
protected int getMaxAssertionMinorVersion()
- Overrides:
getMaxAssertionMinorVersionin classAssertion
-
-