|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.wss.saml.internal.saml20.jaxb20.AssertionType
com.sun.xml.wss.saml.assertion.saml20.jaxb20.Assertion
public class Assertion
This object stands for 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]
[java]
| Field Summary | |
|---|---|
protected static Logger |
log
|
static String |
XMLNS_URI
XML Information Set REC all namespace attributes (including those named xmlns, whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/ |
| Fields inherited from class com.sun.xml.wss.saml.internal.saml20.jaxb20.AssertionType |
|---|
advice, conditions, id, issueInstant, issuer, signature, statementOrAuthnStatementOrAuthzDecisionStatement, subject, version |
| Constructor Summary | |
|---|---|
Assertion(AssertionType assertion)
|
|
Assertion(String assertionID,
NameID issuer,
GregorianCalendar issueInstant,
Conditions conditions,
Advice advice,
Subject subject,
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,
NameID issuer,
GregorianCalendar issueInstant,
Conditions conditions,
Advice advice,
Subject subject,
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. |
|
| Method Summary | |
|---|---|
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. |
String |
getAssertionID()
Get the SAML Assertion ID for SAML1.0 and SAML1.1 |
Conditions |
getConditions()
Gets the value of the conditions property. |
String |
getIssueInstance()
Gets the value of the issueInstant property. |
BigInteger |
getMajorVersion()
Get the SAML Major Vertion for SAML1.0 and SAML1.1 |
BigInteger |
getMinorVersion()
Get the SAML Minor Vertion for SAML1.0 and SAML1.1 |
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. |
Object |
getTokenValue()
The token Value |
String |
getType()
The type of the Token |
boolean |
isSigned()
|
void |
setMajorVersion(BigInteger majorValue)
|
void |
setMinorVersion(BigInteger minorValue)
|
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 includeCert)
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 |
| Methods inherited from class com.sun.xml.wss.saml.internal.saml20.jaxb20.AssertionType |
|---|
getID, getIssueInstant, getIssuer, getSignature, getStatementOrAuthnStatementOrAuthzDecisionStatement, getVersion, setAdvice, setConditions, setID, setIssueInstant, setIssuer, setSignature, setSubject, setVersion |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.xml.wss.saml.Assertion |
|---|
getID, getVersion, setVersion |
| Field Detail |
|---|
public static final String XMLNS_URI
protected static final Logger log
| Constructor Detail |
|---|
public Assertion(AssertionType assertion)
public Assertion(String assertionID,
NameID issuer,
GregorianCalendar issueInstant,
Conditions conditions,
Advice advice,
Subject subject,
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,
NameID issuer,
GregorianCalendar issueInstant,
Conditions conditions,
Advice advice,
Subject subject,
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 asertions.
SAMLException - if there is an error in processing input.| Method Detail |
|---|
public BigInteger getMajorVersion()
Assertion
getMajorVersion in interface Assertionjava.math.BigInteger representing saml major version.public BigInteger getMinorVersion()
Assertion
getMinorVersion in interface Assertionjava.math.BigInteger representing saml minor version.public void setMajorVersion(BigInteger majorValue)
setMajorVersion in interface AssertionmajorValue - A java.math.BigInteger representing saml major version.public void setMinorVersion(BigInteger minorValue)
setMinorVersion in interface AssertionminorValue - A java.math.BigInteger representing saml minor version.public String getAssertionID()
Assertion
getAssertionID in interface Assertionjava.lang.String representing saml assertion ID.public String getSamlIssuer()
Assertion
getSamlIssuer in interface Assertionjava.lang.String representing saml issuer.public String getIssueInstance()
Assertion
getIssueInstance in interface AssertionString representing the issue timestamp of the SAML Assertionpublic Conditions getConditions()
AssertionType
getConditions in interface AssertiongetConditions in class AssertionTypeConditionsTypepublic Advice getAdvice()
AssertionType
getAdvice in interface AssertiongetAdvice in class AssertionTypeAdviceTypepublic Subject getSubject()
AssertionType
getSubject in interface AssertiongetSubject in class AssertionTypeSubjectType
public Element sign(PublicKey pubKey,
PrivateKey privKey)
throws SAMLException
sign in interface AssertionpubKey - PublicKey to be used for Signature verificationprivKey - PrivateKey to be used for Signature calculation
org.w3c.dom.Element representation of Signed SAML Assertion
SAMLException
public Element sign(X509Certificate cert,
PrivateKey privKey,
boolean alwaysIncludeCert)
throws SAMLException
Assertion
sign in interface 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 Assertion
SAMLException
public Element sign(X509Certificate cert,
PrivateKey privKey,
boolean alwaysIncludeCert,
String sigAlgorithm,
String canonicalizationAlgorithm)
throws SAMLException
Assertion
sign in interface 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 Assertion
SAMLException
public Element sign(X509Certificate cert,
PrivateKey privKey)
throws SAMLException
Assertion
sign in interface 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 Assertion
SAMLException
public Element sign(DigestMethod digestMethod,
String signatureMethod,
PublicKey pubKey,
PrivateKey privKey)
throws SAMLException
sign in interface AssertiondigestMethod - DigestMethod to be usedsignatureMethod - SignatureMethod to be used.pubKey - PublicKey to be used for Signature verificationprivKey - PrivateKey to be used for Signature calculation
org.w3c.dom.Element representation of Signed SAML Assertion
SAMLException
public Element sign(DigestMethod digestMethod,
String signatureMethod,
X509Certificate cert,
PrivateKey privKey,
boolean includeCert)
throws SAMLException
Assertion
sign in interface 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.includeCert - 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 Assertion
SAMLException
public Element sign(DigestMethod digestMethod,
String signatureMethod,
X509Certificate cert,
PrivateKey privKey)
throws SAMLException
Assertion
sign in interface 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 Assertion
SAMLException
public Element toElement(Node doc)
throws XWSSecurityException
Assertionorg.w3c.dom.Element
toElement in interface Assertiondoc - 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.
assertionElement - A org.w3c.dom.Element representing
DOM tree for Assertion object
SAMLException - if it could not process the Element properly,
implying that there is an error in the sender or in the
element definition.public String getType()
Token
getType in interface Tokenpublic Object getTokenValue()
Token
getTokenValue in interface Tokenpublic List<Object> getStatements()
Assertion
getStatements in interface Assertionjava.util.List of java.lang.Object
representing all statements present inside the SAML assertion.
public boolean verifySignature(PublicKey pubKey)
throws SAMLException
Assertion
verifySignature in interface AssertionpubKey - A java.security.PublicKey representing the public key used for Signature verification
Boolean representing whether SAML signature verification is successful or not.
SAMLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||