public class SecurityTokenReference extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ENC_KEY_SHA1_URI |
static String |
SECURITY_TOKEN_REFERENCE |
static String |
SKI_URI |
static QName |
STR_QNAME |
static String |
THUMB_URI |
static String |
X509_V3_TYPE |
Constructor and Description |
---|
SecurityTokenReference(Document doc)
Constructor.
|
SecurityTokenReference(Element elem,
BSPEnforcer bspEnforcer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addTokenType(String tokenType)
Add a wsse11:TokenType attribute to this SecurityTokenReference
|
void |
addWSSENamespace()
Add the WSSE Namespace to this STR.
|
void |
addWSUNamespace()
Add the WSU Namespace to this STR.
|
boolean |
containsKeyIdentifier()
Method containsKeyIdentifier.
|
boolean |
containsReference()
Method containsReference
|
boolean |
containsX509Data()
Method containsX509Data
|
boolean |
containsX509IssuerSerial()
Method containsX509IssuerSerial
|
boolean |
equals(Object object) |
Element |
getElement()
Get the DOM element.
|
Element |
getFirstElement()
get the first child element.
|
String |
getID()
Get the id
|
X509Certificate[] |
getKeyIdentifier(Crypto crypto)
Gets the KeyIdentifier.
|
String |
getKeyIdentifierEncodingType() |
String |
getKeyIdentifierValue() |
String |
getKeyIdentifierValueType() |
Reference |
getReference()
Gets the Reference.
|
byte[] |
getSKIBytes() |
String |
getTokenType()
Get the wsse11:TokenType attribute of this SecurityTokenReference
|
X509Certificate[] |
getX509IssuerSerial(Crypto crypto)
Gets the certificate identified with X509 issuerSerial data.
|
X509Certificate |
getX509SKIAlias(Crypto crypto) |
int |
hashCode() |
void |
setID(String id)
set the id.
|
void |
setKeyIdentifier(String valueType,
String keyIdVal) |
void |
setKeyIdentifier(String valueType,
String keyIdVal,
boolean base64) |
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 |
setUnknownElement(Element unknownElement)
Set an unknown element.
|
String |
toString()
return the string representation.
|
public static final String SECURITY_TOKEN_REFERENCE
public static final QName STR_QNAME
public static final String SKI_URI
public static final String THUMB_URI
public static final String ENC_KEY_SHA1_URI
public static final String X509_V3_TYPE
public SecurityTokenReference(Element elem, BSPEnforcer bspEnforcer) throws WSSecurityException
elem
- A SecurityTokenReference elementbspEnforcer
- a BSPEnforcer instance to enforce BSP rulesWSSecurityException
public SecurityTokenReference(Document doc)
doc
- The Documentpublic void addWSSENamespace()
public void addWSUNamespace()
public void addTokenType(String tokenType)
tokenType
- the wsse11:TokenType attribute to addpublic String getTokenType()
public void setReference(Reference ref)
ref
- public Reference getReference() throws WSSecurityException
Reference
element contained in this
SecurityTokenReferenceWSSecurityException
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 setKeyIdentifier(String valueType, String keyIdVal) throws WSSecurityException
WSSecurityException
public void setKeyIdentifier(String valueType, String keyIdVal, boolean base64) throws WSSecurityException
WSSecurityException
public Element getFirstElement()
Element
child nodepublic X509Certificate[] getKeyIdentifier(Crypto crypto) throws WSSecurityException
WSSecurityException
public String getKeyIdentifierValue()
public String getKeyIdentifierValueType()
public String getKeyIdentifierEncodingType()
public X509Certificate getX509SKIAlias(Crypto crypto) throws WSSecurityException
WSSecurityException
public byte[] getSKIBytes()
public void setUnknownElement(Element unknownElement)
unknownElement
- the org.w3c.dom.Element to put into this
SecurityTokenReferencepublic X509Certificate[] getX509IssuerSerial(Crypto crypto) throws WSSecurityException
WSSecurityException
public boolean containsReference()
SecurityTokenReference
contains
a wsse:Reference
elementpublic boolean containsX509IssuerSerial()
SecurityTokenReference
contains
a ds:IssuerSerial
elementpublic boolean containsX509Data()
SecurityTokenReference
contains
a ds:X509Data
elementpublic boolean containsKeyIdentifier()
SecurityTokenReference
contains
a wsse:KeyIdentifier
elementpublic Element getElement()
public void setID(String id)
id
- public String getID()
public String toString()
Copyright © 2016 JBoss by Red Hat. All rights reserved.