Class BinarySecurityToken
- java.lang.Object
-
- com.sun.identity.liberty.ws.common.wsse.BinarySecurityToken
-
public class BinarySecurityToken extends Object
The classBinarySecurityTokenprovides interface to parse and create X.509 Security Token depicted by Web Service Security : X.509 Certificate Token Profile and Liberty ID-WSF Security Mechanisms specifications.The following schema fragment specifies the expected content within the BinarySecurityToken object.
<element name="BinarySecurityToken" type="wsse:BinarySecurityTokenType/> <complexType name="BinarySecurityTokenType"> <simpleContent> <extension base="<http://schemas.xmlsoap.org/ws/2003/06/secext>EncodedString"> <attribute name="ValueType" type="{http://www.w3.org/2001/XMLSchema}QName" /> </extension> </simpleContent> </complexType> <xsd:complexType name="EncodedString"> <xsd:simpleContent> <xsd:extension base="wsse:AttributedString"> <xsd:attribute name="EncodingType" type="xsd:QName"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="AttributedString"> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute ref="wsu:Id"/> <xsd:anyAttribute namespace="##other" processContents="lax"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType>
-
-
Field Summary
Fields Modifier and Type Field Description static QNameBASE64BINARYTheBASE64BINARYencoding type indicates that the encoding name given corresponds to base64 encoding of a binary value.static QNameHEXBINARYTheHEXBINARYencoding type indicates that the encoding name given corresponds to Hex encoding of a binary value.static QNameKERBEROSV5STTheKERBEROSV5STvalue type indicates that the value name given corresponds to a Kerberos V5 service ticket.static QNameKERBEROSV5TGTTheKERBEROSV5TGTvalue type indicates that the value name given corresponds to a Kerberos V5 TGT.static QNamePKCS7ThePKCS7value type indicates that the value name given corresponds to a PKCS7 object.static QNamePKIPathThePKIPATHvalue type indicates that the value name given corresponds to a PKI Path object.static QNameX509V3TheX509V3value type indicates that the value name given corresponds to a X509 Certificate.
-
Constructor Summary
Constructors Constructor Description BinarySecurityToken(String value, QName valueType, QName encodingType)Constructor.BinarySecurityToken(Element token)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToParent(Element headerE)Adds th binary security token to the header element.QNamegetEncodingType()Gets encoding type for the token.StringgetId()Gets id attribute for the tokens.StringgetTokenValue()Gets value of the token.QNamegetValueType()Gets value type for the token.StringgetWSFVersion()Returns the web services version.voidsetWSFVersion(String version)Sets the web services version.StringtoString()Returns a String representation of the token.
-
-
-
Field Detail
-
X509V3
public static final QName X509V3
TheX509V3value type indicates that the value name given corresponds to a X509 Certificate.
-
KERBEROSV5TGT
public static final QName KERBEROSV5TGT
TheKERBEROSV5TGTvalue type indicates that the value name given corresponds to a Kerberos V5 TGT.
-
KERBEROSV5ST
public static final QName KERBEROSV5ST
TheKERBEROSV5STvalue type indicates that the value name given corresponds to a Kerberos V5 service ticket.
-
PKCS7
public static final QName PKCS7
ThePKCS7value type indicates that the value name given corresponds to a PKCS7 object.
-
PKIPath
public static final QName PKIPath
ThePKIPATHvalue type indicates that the value name given corresponds to a PKI Path object.
-
BASE64BINARY
public static final QName BASE64BINARY
TheBASE64BINARYencoding type indicates that the encoding name given corresponds to base64 encoding of a binary value.
-
HEXBINARY
public static final QName HEXBINARY
TheHEXBINARYencoding type indicates that the encoding name given corresponds to Hex encoding of a binary value.
-
-
Constructor Detail
-
BinarySecurityToken
public BinarySecurityToken(String value, QName valueType, QName encodingType) throws Exception
Constructor.- Parameters:
value- the value must be the specifiedvalueTypeand encoded in the specifiedencodingType.valueType- type of the valueencodingType- encoding type of the value- Throws:
Exception- if any input parameter is null
-
-
Method Detail
-
getEncodingType
public QName getEncodingType()
Gets encoding type for the token.- Returns:
- encoding type for the token.
-
getValueType
public QName getValueType()
Gets value type for the token.- Returns:
- value type for the token.
-
getId
public String getId()
Gets id attribute for the tokens.- Returns:
- id attribute for the token.
-
getTokenValue
public String getTokenValue()
Gets value of the token.- Returns:
- value of the token.
-
toString
public String toString()
Returns a String representation of the token.
-
addToParent
public void addToParent(Element headerE) throws Exception
Adds th binary security token to the header element.- Parameters:
headerE- the security header element.- Throws:
Exception- if there is a failure in adding to the header.
-
getWSFVersion
public String getWSFVersion()
Returns the web services version.- Returns:
- the web services version.
-
setWSFVersion
public void setWSFVersion(String version)
Sets the web services version.- Parameters:
version- the web services version.
-
-