public class Assertion extends com.sun.xml.wss.saml.internal.saml11.jaxb10.impl.AssertionImpl implements Assertion
Assertion element. An Assertion is a package
of information that supplies one or more Statement made by an
issuer. There are three kinds of assertions Au [java] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
[java] com.sun.xml.wss.saml.internal.saml11.jaxb10.impl.AssertionImpl.Unmarshaller| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
log |
_Advice, _AssertionID, _Conditions, _IssueInstant, _Issuer, _MajorVersion, _MinorVersion, _Signature, _StatementOrSubjectStatementOrAuthenticationStatement| Constructor and Description |
|---|
Assertion(com.sun.xml.wss.saml.internal.saml11.jaxb10.impl.AssertionImpl assertion) |
Assertion(String assertionID,
String issuer,
Calendar issueInstant,
Conditions conditions,
Advice advice,
List statements)
This constructor is used to populate the data members: the
assertionID, the issuer, time when assertion issued,
the conditions when creating a new assertion , Advice
applicable to this Assertion and a set of
Statement(s) in the assertion. |
Assertion(String assertionID,
String issuer,
Calendar issueInstant,
Conditions conditions,
Advice advice,
List statements,
JAXBContext jcc)
This constructor is used to populate the data members: the
assertionID, the issuer, time when assertion issued,
the conditions when creating a new assertion , Advice
applicable to this Assertion , a set of
Statement(s) and a JAXBContext for the assertion. |
| Modifier and Type | Method and Description |
|---|---|
static Assertion |
fromElement(Element element)
This constructor is used to build
Assertion object from a
block of existing XML that has already been built into a DOM. |
Advice |
getAdvice()
Gets the value of the advice property of SAML
|
Conditions |
getConditions()
Gets the value of the conditions property of SAML
|
String |
getID()
Get the SAML Assertion ID for SAML2.0
|
String |
getIssueInstance()
Gets the value of the issueInstant property.
|
String |
getSamlIssuer()
Get the issuer of SAML Assertion
|
List<Object> |
getStatements()
Return all statements presents in the SAML Assertion.
|
Subject |
getSubject()
Gets the value of the subject property of SAML 2.0
This method should be applied only on SAML 2.0 assertion.
|
Object |
getTokenValue() |
String |
getType() |
String |
getVersion()
Get the SAML Vertion SAML2.0
|
boolean |
isSigned() |
void |
setVersion(String version) |
Element |
sign(DigestMethod digestMethod,
String signatureMethod,
PublicKey pubKey,
PrivateKey privKey)
sign the saml assertion (Enveloped Signature)
|
Element |
sign(DigestMethod digestMethod,
String signatureMethod,
X509Certificate cert,
PrivateKey privKey)
Sign the SAML Assertion - Enveloped Signature
|
Element |
sign(DigestMethod digestMethod,
String signatureMethod,
X509Certificate cert,
PrivateKey privKey,
boolean alwaysIncludeCert)
Sign the SAML Assertion - Enveloped Signature
|
Element |
sign(PublicKey pubKey,
PrivateKey privKey)
sign the saml assertion (Enveloped Signature)
|
Element |
sign(X509Certificate cert,
PrivateKey privKey)
Sign the SAML Assertion - Enveloped Signature
|
Element |
sign(X509Certificate cert,
PrivateKey privKey,
boolean alwaysIncludeCert)
Sign the SAML Assertion - Enveloped Signature
|
Element |
sign(X509Certificate cert,
PrivateKey privKey,
boolean alwaysIncludeCert,
String sigAlgorithm,
String canonicalizationAlgorithm)
Sign the SAML Assertion - Enveloped Signature
|
Element |
toElement(Node doc)
Convert SAML Assertion to
org.w3c.dom.Element |
boolean |
verifySignature(PublicKey pubKey)
Verify the SAML signature with the Public Key
|
____jaxb_ri____getLocalName, ____jaxb_ri____getNamespaceURI, createRawValidator, createUnmarshaller, getPrimaryInterface, serializeAttributes, serializeBody, serializeURIs____jaxb____getId, _getStatementOrSubjectStatementOrAuthenticationStatement, getAssertionID, getIssueInstant, getIssuer, getMajorVersion, getMinorVersion, getSignature, getStatementOrSubjectStatementOrAuthenticationStatement, setAdvice, setAssertionID, setConditions, setIssueInstant, setIssuer, setMajorVersion, setMinorVersion, setSignatureclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAssertionID, getMajorVersion, getMinorVersion, setMajorVersion, setMinorVersiongetAssertionID, getIssueInstant, getIssuer, getMajorVersion, getMinorVersion, getSignature, getStatementOrSubjectStatementOrAuthenticationStatement, setAdvice, setAssertionID, setConditions, setIssueInstant, setIssuer, setMajorVersion, setMinorVersion, setSignatureprotected static final Logger log
public Assertion(com.sun.xml.wss.saml.internal.saml11.jaxb10.impl.AssertionImpl assertion)
public Assertion(String assertionID, String issuer, Calendar issueInstant, Conditions conditions, Advice advice, List statements) throws SAMLException
assertionID, the issuer, time when assertion issued,
the conditions when creating a new assertion , Advice
applicable to this Assertion and a set of
Statement(s) in the assertion.assertionID - AssertionID object contained within this
Assertion if null its generated internally.issuer - The issuer of this assertion.issueInstant - Time instant of the issue. It has type
dateTime which is built in to the W3C XML Schema
Types specification. if null, current time is used.conditions - Conditions under which the this
Assertion is valid.advice - Advice applicable for this
Assertion.statements - List of Statement objects within this
Assertion. It could be of type
AuthenticationStatement,
AuthorizationDecisionStatement and
AttributeStatement. Each Assertion can have
multiple type of statements in it.SAMLException - if there is an error in processing input.public Assertion(String assertionID, String issuer, Calendar issueInstant, Conditions conditions, Advice advice, List statements, JAXBContext jcc) throws SAMLException
assertionID, the issuer, time when assertion issued,
the conditions when creating a new assertion , Advice
applicable to this Assertion , a set of
Statement(s) and a JAXBContext for the assertion.assertionID - AssertionID object contained within this
Assertion if null its generated internally.issuer - The issuer of this assertion.issueInstant - Time instant of the issue. It has type
dateTime which is built in to the W3C XML Schema
Types specification. if null, current time is used.conditions - Conditions under which the this
Assertion is valid.advice - Advice applicable for this
Assertion.statements - List of Statement objects within this
Assertion. It could be of type
AuthenticationStatement,
AuthorizationDecisionStatement and
AttributeStatement. Each Assertion can have
multiple type of statements in it.jcc - JAXBContext to be used for marshaling and unmarshalling the assertions.SAMLException - if there is an error in processing input.public String getVersion()
Assertionjava.lang.String representing saml version.public void setVersion(String version)
version - A java.lang.String representing saml versionpublic String getID()
Assertionjava.lang.String representing saml assertion ID.public String getSamlIssuer()
Assertionjava.lang.String representing saml issuer.public String getIssueInstance()
AssertionString representing the issue timestamp of the SAML Assertionpublic Conditions getConditions()
AssertiongetConditions in interface com.sun.xml.wss.saml.internal.saml11.jaxb10.AssertionTypegetConditions in class com.sun.xml.wss.saml.internal.saml11.jaxb10.impl.AssertionTypeImplConditions representing conditions of the SAML Assertion.public Advice getAdvice()
AssertiongetAdvice in interface com.sun.xml.wss.saml.internal.saml11.jaxb10.AssertionTypegetAdvice in class com.sun.xml.wss.saml.internal.saml11.jaxb10.impl.AssertionTypeImplAdvice representing Advice element present in the SAML Assertion.public Subject getSubject()
AssertionAssertion object, then call
the getSubject() on each statement.Subject representing Subject of SAML 2.0public Element sign(PublicKey pubKey, PrivateKey privKey) throws SAMLException
pubKey - PublicKey to be used for Signature verificationprivKey - PrivateKey to be used for Signature calculationorg.w3c.dom.Element representation of Signed SAML AssertionSAMLExceptionpublic Element sign(X509Certificate cert, PrivateKey privKey, boolean alwaysIncludeCert) throws SAMLException
Assertioncert - A java.security.cert.X509Certificate representing the certificate used for Signature verificationprivKey - A java.security.PrivateKey representing the private key used for Signature calculation.alwaysIncludeCert - A flag to tell whether to incude the certificate in the SAML signature.
By Default DigestMethod.SHA1, SignatureMethod.RSA_SHA1 and CanonicalizationMethod.EXCLUSIVE will be used.org.w3c.dom.Element representation of Signed SAML AssertionSAMLExceptionpublic Element sign(X509Certificate cert, PrivateKey privKey, boolean alwaysIncludeCert, String sigAlgorithm, String canonicalizationAlgorithm) throws SAMLException
Assertioncert - A java.security.cert.X509Certificate representing the certificate used for Signature verificationprivKey - A java.security.PrivateKey representing the private key used for Signature calculation.alwaysIncludeCert - A flag to tell whether to incude the certificate in the SAML signature.sigAlgorithm - A javax.xml.crypto.dsig.SignatureMethod representing the signature algorithm used SAML signature.canonicalizationAlgorithm - A javax.xml.crypto.dsig.CanonicalizationMethod representing the canonicalization algorithm used SAML signature.
By Default DigestMethod.SHA1, SignatureMethod.RSA_SHA1 and CanonicalizationMethod.EXCLUSIVE will be used.org.w3c.dom.Element representation of Signed SAML AssertionSAMLExceptionpublic Element sign(X509Certificate cert, PrivateKey privKey) throws SAMLException
Assertioncert - A java.security.cert.X509Certificate representing the certificate used for Signature verificationprivKey - A java.security.PrivateKey representing the private key used for Signature calculation.
By Default DigestMethod.SHA1, SignatureMethod.RSA_SHA1 and CanonicalizationMethod.EXCLUSIVE will be used.org.w3c.dom.Element representation of Signed SAML AssertionSAMLExceptionpublic Element sign(DigestMethod digestMethod, String signatureMethod, PublicKey pubKey, PrivateKey privKey) throws SAMLException
digestMethod - DigestMethod to be usedsignatureMethod - SignatureMethod to be used.pubKey - PublicKey to be used for Signature verificationprivKey - PrivateKey to be used for Signature calculationorg.w3c.dom.Element representation of Signed SAML AssertionSAMLExceptionpublic Element sign(DigestMethod digestMethod, String signatureMethod, X509Certificate cert, PrivateKey privKey, boolean alwaysIncludeCert) throws SAMLException
AssertiondigestMethod - A javax.xml.crypto.dsig.DigestMethod representing the digest method used for SAML signature.signatureMethod - A javax.xml.crypto.dsig.SignatureMethod representing the signature algorithm used SAML signature.cert - A java.security.cert.X509Certificate representing the certificate used for Signature verificationprivKey - A java.security.PrivateKey representing the private key used for Signature calculation.alwaysIncludeCert - A flag to tell whether to incude the certificate in the SAML signature.
By Default DigestMethod.SHA1, SignatureMethod.RSA_SHA1 and CanonicalizationMethod.EXCLUSIVE will be used.org.w3c.dom.Element representation of Signed SAML AssertionSAMLExceptionpublic Element sign(DigestMethod digestMethod, String signatureMethod, X509Certificate cert, PrivateKey privKey) throws SAMLException
AssertiondigestMethod - A javax.xml.crypto.dsig.DigestMethod representing the digest method used for SAML signature.signatureMethod - A javax.xml.crypto.dsig.SignatureMethod representing the signature algorithm used SAML signature.cert - A java.security.cert.X509Certificate representing the certificate used for Signature verificationprivKey - A java.security.PrivateKey representing the private key used for Signature calculation.
By Default DigestMethod.SHA1, SignatureMethod.RSA_SHA1 and CanonicalizationMethod.EXCLUSIVE will be used.org.w3c.dom.Element representation of Signed SAML AssertionSAMLExceptionpublic Element toElement(Node doc) throws XWSSecurityException
Assertionorg.w3c.dom.Elementdoc - the context org.w3c.dom.Node for the creation of the resulting org.w3c.dom.Element.XWSSecurityExceptionpublic boolean isSigned()
public static Assertion fromElement(Element element) throws SAMLException
Assertion object from a
block of existing XML that has already been built into a DOM.element - A org.w3c.dom.Element representing
DOM tree for Assertion objectSAMLException - if it could not process the Element properly,
implying that there is an error in the sender or in the
element definition.public List<Object> getStatements()
Assertionjava.util.List of java.lang.Object
representing all statements present inside the SAML assertion.public Object getTokenValue()
getTokenValue in interface Tokenpublic boolean verifySignature(PublicKey pubKey) throws SAMLException
AssertionpubKey - A java.security.PublicKey representing the public key used for Signature verificationBoolean representing whether SAML signature verification is successful or not.SAMLExceptionCopyright © 2005–2017 Oracle Corporation. All rights reserved.