public class SecurityTokenReference extends Object
Modifier and Type | Field and Description |
---|---|
protected org.w3c.dom.Element |
element |
static String |
ENC_KEY_SHA1_URI |
static String |
KEY_NAME |
static String |
SAML_ID_URI |
static String |
SECURITY_TOKEN_REFERENCE |
static String |
SKI_URI |
static 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 |
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.
|
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. |
String |
getKeyIdentifierValue() |
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. |
X509Certificate[] |
getX509IssuerSerial(Crypto crypto)
Gets the certificate identified with X509 issuerSerial data.
|
String |
getX509IssuerSerialAlias(Crypto crypto)
Gets the alias name of the certificate identified with X509 issuerSerial data.
|
String |
getX509SKIAlias(Crypto crypto) |
int |
length(String namespace,
String localname)
Method length.
|
int |
lengthKeyIdentifier()
Method lengthKeyIdentifier.
|
int |
lengthReference()
Method lengthReference.
|
int |
lengthX509Data()
Method lengthX509Data.
|
int |
lengthX509IssuerSerial()
Method lengthX509IssuerSerial.
|
void |
setID(String id)
set the id.
|
void |
setKeyIdentifier(String valueType,
String keyIdVal) |
void |
setKeyIdentifier(X509Certificate cert)
Sets the KeyIdentifier Element as a X509 certificate.
|
void |
setKeyIdentifierEncKeySHA1(String value) |
void |
setKeyIdentifierSKI(X509Certificate cert,
Crypto crypto)
Sets the KeyIdentifier Element as a X509 Subject-Key-Identifier (SKI).
|
void |
setKeyIdentifierThumb(X509Certificate cert)
Sets the KeyIdentifier Element as a Thumbprint.
|
void |
setReference(Reference ref)
set the reference.
|
void |
setSAMLKeyIdentifier(String keyIdVal) |
void |
setX509IssuerSerial(org.apache.xml.security.keys.content.X509Data ref)
Sets the X509 IssuerSerial data.
|
String |
toString()
return the string representation.
|
public static final String SECURITY_TOKEN_REFERENCE
public static final String KEY_NAME
public static final String SKI_URI
public static final String THUMB_URI
public static final String SAML_ID_URI
public static final String ENC_KEY_SHA1_URI
protected org.w3c.dom.Element element
public SecurityTokenReference(org.w3c.dom.Element elem) throws WSSecurityException
elem
- TODOWSSecurityException
public SecurityTokenReference(org.w3c.dom.Document doc)
doc
- TODOpublic void setReference(Reference ref)
ref
- public Reference getReference() throws WSSecurityException
Reference
element contained in this
SecurityTokenReferenceWSSecurityException
public 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() methodWSSecurityException
public void setKeyIdentifier(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 identifierWSSecurityException
public void setKeyIdentifierSKI(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 certificateWSSecurityException
public void setKeyIdentifierThumb(X509Certificate cert) throws WSSecurityException
wsse:KeyIdentifier
element, which is placed in the wsse:SecurityTokenReference
element.cert
- is the X509 certificate to get the thumbprintWSSecurityException
public void setKeyIdentifierEncKeySHA1(String value) throws WSSecurityException
WSSecurityException
public void setSAMLKeyIdentifier(String keyIdVal) throws WSSecurityException
WSSecurityException
public void setKeyIdentifier(String valueType, String keyIdVal) throws WSSecurityException
WSSecurityException
public org.w3c.dom.Element getFirstElement()
Element
child nodepublic X509Certificate[] getKeyIdentifier(Crypto crypto) throws WSSecurityException
WSSecurityException
public String getKeyIdentifierValue()
public String getKeyIdentifierValueType()
public String getX509SKIAlias(Crypto crypto) throws WSSecurityException
WSSecurityException
public byte[] getSKIBytes()
public void setX509IssuerSerial(org.apache.xml.security.keys.content.X509Data ref)
ref
- the XMLX509IssuerSerial
to put into this
SecurityTokenReferencepublic X509Certificate[] getX509IssuerSerial(Crypto crypto) throws WSSecurityException
WSSecurityException
public String getX509IssuerSerialAlias(Crypto crypto) throws WSSecurityException
WSSecurityException
public boolean containsReference()
SecurtityTokenReference
contains
a wsse:Reference
elementpublic int lengthReference()
wsse:Reference
elements in
the SecurtityTokenReference
public boolean containsX509IssuerSerial()
SecurtityTokenReference
contains
a ds:IssuerSerial
elementpublic boolean containsX509Data()
SecurtityTokenReference
contains
a ds:X509Data
elementpublic int lengthX509IssuerSerial()
ds:IssuerSerial
elements in
the SecurtityTokenReference
public int lengthX509Data()
ds:IssuerSerial
elements in
the SecurtityTokenReference
public boolean containsKeyIdentifier()
SecurtityTokenReference
contains
a wsse:KeyIdentifier
elementpublic int lengthKeyIdentifier()
wsse:KeyIdentifier
elements in
the SecurtityTokenReference
public int length(String namespace, String localname)
namespace
- localname
- public org.w3c.dom.Element getElement()
public void setID(String id)
id
- Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.