public class SecurityTokenReference
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected org.w3c.dom.Element |
element |
static java.lang.String |
ENC_KEY_SHA1_URI |
static java.lang.String |
KEY_NAME |
static java.lang.String |
SAML_ID_URI |
static java.lang.String |
SECURITY_TOKEN_REFERENCE |
static java.lang.String |
SKI_URI |
static java.lang.String |
THUMB_URI |
| Constructor and Description |
|---|
SecurityTokenReference(org.w3c.dom.Document doc)
Constructor.
|
SecurityTokenReference(org.w3c.dom.Element elem)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKerberosThumbprint() |
boolean |
containsKeyIdentifier()
Method containsKeyIdentifier.
|
boolean |
containsReference()
Method containsReference
|
boolean |
containsX509Data()
Method containsX509Data
|
boolean |
containsX509IssuerSerial()
Method containsX509IssuerSerial
|
org.w3c.dom.Element |
getElement()
get the dom element.
|
org.w3c.dom.Element |
getFirstElement()
get the first child element.
|
KrbSession |
getKerberosSession() |
java.security.cert.X509Certificate[] |
getKeyIdentifier(Crypto crypto)
Gets the KeyIdentifier.
|
org.w3c.dom.Element |
getKeyIdentifierTokenElement(org.w3c.dom.Document doc,
WSDocInfo docInfo,
javax.security.auth.callback.CallbackHandler cb)
Gets the signing token element, which may be a
BinarySecurityToken
or a SAML token. |
java.lang.String |
getKeyIdentifierValue() |
java.lang.String |
getKeyIdentifierValueType() |
Reference |
getReference()
Gets the Reference.
|
byte[] |
getSKIBytes() |
org.w3c.dom.Element |
getTokenElement(org.w3c.dom.Document doc,
WSDocInfo docInfo,
javax.security.auth.callback.CallbackHandler cb)
Gets the signing token element, which maybe a
BinarySecurityToken
or a SAML token. |
java.security.cert.X509Certificate[] |
getX509IssuerSerial(Crypto crypto)
Gets the certificate identified with X509 issuerSerial data.
|
java.lang.String |
getX509IssuerSerialAlias(Crypto crypto)
Gets the alias name of the certificate identified with X509 issuerSerial data.
|
java.lang.String |
getX509SKIAlias(Crypto crypto) |
int |
length(java.lang.String namespace,
java.lang.String localname)
Method length.
|
int |
lengthKeyIdentifier()
Method lengthKeyIdentifier.
|
int |
lengthReference()
Method lengthReference.
|
int |
lengthX509Data()
Method lengthX509Data.
|
int |
lengthX509IssuerSerial()
Method lengthX509IssuerSerial.
|
void |
setID(java.lang.String id)
set the id.
|
void |
setKerberosIdentifierThumb(KrbSession session) |
void |
setKeyIdentifier(java.lang.String valueType,
java.lang.String keyIdVal) |
void |
setKeyIdentifier(java.security.cert.X509Certificate cert)
Sets the KeyIdentifier Element as a X509 certificate.
|
void |
setKeyIdentifierEncKeySHA1(java.lang.String value) |
void |
setKeyIdentifierSKI(java.security.cert.X509Certificate cert,
Crypto crypto)
Sets the KeyIdentifier Element as a X509 Subject-Key-Identifier (SKI).
|
void |
setKeyIdentifierThumb(java.security.cert.X509Certificate cert)
Sets the KeyIdentifier Element as a Thumbprint.
|
void |
setReference(Reference ref)
set the reference.
|
void |
setSAMLKeyIdentifier(java.lang.String keyIdVal) |
void |
setX509IssuerSerial(org.apache.xml.security.keys.content.X509Data ref)
Sets the X509 IssuerSerial data.
|
java.lang.String |
toString()
return the string representation.
|
public static final java.lang.String SECURITY_TOKEN_REFERENCE
public static final java.lang.String KEY_NAME
public static final java.lang.String SKI_URI
public static final java.lang.String THUMB_URI
public static final java.lang.String SAML_ID_URI
public static final java.lang.String ENC_KEY_SHA1_URI
protected org.w3c.dom.Element element
public SecurityTokenReference(org.w3c.dom.Element elem)
throws WSSecurityException
elem - TODOWSSecurityExceptionpublic SecurityTokenReference(org.w3c.dom.Document doc)
doc - TODOpublic void setReference(Reference ref)
ref - public Reference getReference() throws WSSecurityException
Reference element contained in this SecurityTokenReferenceWSSecurityExceptionpublic org.w3c.dom.Element getTokenElement(org.w3c.dom.Document doc,
WSDocInfo docInfo,
javax.security.auth.callback.CallbackHandler cb)
throws WSSecurityException
BinarySecurityToken
or a SAML token.
The method gets the URI attribute of the Reference contained in the
SecurityTokenReference and tries to find the referenced Element in the document.doc - the document that contains the binary security token element. This could be
different from the document that contains the SecurityTokenReference (STR). See
STRTransform.derefenceBST() methodWSSecurityException - When either no Reference element, or the found reference contains no
URI, or the referenced signing not found.public org.w3c.dom.Element getKeyIdentifierTokenElement(org.w3c.dom.Document doc,
WSDocInfo docInfo,
javax.security.auth.callback.CallbackHandler cb)
throws WSSecurityException
BinarySecurityToken
or a SAML token.
The method gets the value of the KeyIdentifier contained in the
SecurityTokenReference and tries to find the referenced Element in the document.doc - the document that contains the binary security token element. This could be
different from the document that contains the SecurityTokenReference (STR). See
STRTransform.derefenceBST() methodWSSecurityExceptionpublic void setKeyIdentifier(java.security.cert.X509Certificate cert)
throws WSSecurityException
wsse:KeyIdentifier element, which is
placed in the wsse:SecurityTokenReference element.cert - is the X509 certificate to be inserted as key identifierWSSecurityExceptionpublic void setKeyIdentifierSKI(java.security.cert.X509Certificate cert,
Crypto crypto)
throws WSSecurityException
wsse:KeyIdentifier element, which is placed in the
wsse:SecurityTokenReference element.cert - is the X509 certificate to get the SKIcrypto - is the Crypto implementation. Used to read SKI info bytes from certificateWSSecurityExceptionpublic void setKeyIdentifierThumb(java.security.cert.X509Certificate cert)
throws WSSecurityException
wsse:KeyIdentifier element, which is placed in the
wsse:SecurityTokenReference element.cert - is the X509 certificate to get the thumbprintWSSecurityExceptionpublic void setKeyIdentifierEncKeySHA1(java.lang.String value)
throws WSSecurityException
WSSecurityExceptionpublic void setSAMLKeyIdentifier(java.lang.String keyIdVal)
throws WSSecurityException
WSSecurityExceptionpublic void setKeyIdentifier(java.lang.String valueType,
java.lang.String keyIdVal)
throws WSSecurityException
WSSecurityExceptionpublic org.w3c.dom.Element getFirstElement()
Element child nodepublic java.security.cert.X509Certificate[] getKeyIdentifier(Crypto crypto) throws WSSecurityException
WSSecurityExceptionpublic java.lang.String getKeyIdentifierValue()
public java.lang.String getKeyIdentifierValueType()
public java.lang.String getX509SKIAlias(Crypto crypto) throws WSSecurityException
WSSecurityExceptionpublic byte[] getSKIBytes()
public void setX509IssuerSerial(org.apache.xml.security.keys.content.X509Data ref)
ref - the XMLX509IssuerSerial to put into this SecurityTokenReferencepublic java.security.cert.X509Certificate[] getX509IssuerSerial(Crypto crypto) throws WSSecurityException
WSSecurityExceptionpublic java.lang.String getX509IssuerSerialAlias(Crypto crypto) throws WSSecurityException
WSSecurityExceptionpublic boolean containsReference()
SecurtityTokenReference contains a
wsse:Reference elementpublic int lengthReference()
wsse:Reference elements in the
SecurtityTokenReferencepublic boolean containsX509IssuerSerial()
SecurtityTokenReference contains a
ds:IssuerSerial elementpublic boolean containsX509Data()
SecurtityTokenReference contains a ds:X509Data
elementpublic int lengthX509IssuerSerial()
ds:IssuerSerial elements in the
SecurtityTokenReferencepublic int lengthX509Data()
ds:IssuerSerial elements in the
SecurtityTokenReferencepublic boolean containsKeyIdentifier()
SecurtityTokenReference contains a
wsse:KeyIdentifier elementpublic int lengthKeyIdentifier()
wsse:KeyIdentifier elements in the
SecurtityTokenReferencepublic int length(java.lang.String namespace,
java.lang.String localname)
namespace - localname - public org.w3c.dom.Element getElement()
public void setID(java.lang.String id)
id - public java.lang.String toString()
toString in class java.lang.Objectpublic void setKerberosIdentifierThumb(KrbSession session)
session - public boolean containsKerberosThumbprint()
public KrbSession getKerberosSession()
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.