Package com.sun.identity.wss.security
Class BinarySecurityToken
- java.lang.Object
-
- com.sun.identity.wss.security.BinarySecurityToken
-
- All Implemented Interfaces:
SecurityToken
public class BinarySecurityToken extends Object implements SecurityToken
This classBinarySecurityTokenrepresents an X509 token that can be inserted into web services security header for message level security.This class implements
SecurityTokenand can be created through security token factory.
-
-
Field Summary
Fields Modifier and Type Field Description static StringBASE64BINARYTheBASE64BINARYencoding type indicates that the encoding name given corresponds to base64 encoding of a binary valuestatic StringHEXBINARYTheHEXBINARYencoding type indicates that the encoding name given corresponds to Hex encoding of a binary valuestatic StringPKCS7ThePKCS7value type indicates that the value name given corresponds to a PKCS7 objectstatic StringPKIPATHThePKIPATHvalue type indicates that the value name given corresponds to a PKI Path objectstatic StringX509V3TheX509V3value type indicates that the value name given corresponds to a X509 Certificate-
Fields inherited from interface com.sun.identity.wss.security.SecurityToken
LIBERTY_ASSERTION_TOKEN, WSS_FAM_SSO_TOKEN, WSS_KERBEROS_TOKEN, WSS_SAML_TOKEN, WSS_SAML2_TOKEN, WSS_USERNAME_TOKEN, WSS_X509_TOKEN
-
-
Constructor Summary
Constructors Constructor Description BinarySecurityToken(KerberosTokenSpec kbSpec)Constructor to create Kerberos TokenBinarySecurityToken(X509TokenSpec tokenSpec)ConstructorBinarySecurityToken(X509Certificate cert, String valueType, String encodingType)BinarySecurityToken(Element token)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetEncodingType()Gets encoding type for the token.StringgetId()Gets id attribute for the tokens.KeygetSecretKey()Returns the secret key for kerberos token.StringgetSigningId()Returns the signing id for binary security token.String[]getSubjectCertAlias()Returns the array of certificate aliases defined in this spec.StringgetTokenType()Returns the token type.StringgetTokenValue()Gets value of the token.StringgetValueType()Gets value type for the token.ElementtoDocumentElement()Returns theDOMElement of the binary security token.StringtoString()Returns a String representation of the token
-
-
-
Field Detail
-
X509V3
public static final String X509V3
TheX509V3value type indicates that the value name given corresponds to a X509 Certificate- See Also:
- Constant Field Values
-
PKCS7
public static final String PKCS7
ThePKCS7value type indicates that the value name given corresponds to a PKCS7 object- See Also:
- Constant Field Values
-
PKIPATH
public static final String PKIPATH
ThePKIPATHvalue type indicates that the value name given corresponds to a PKI Path object- See Also:
- Constant Field Values
-
BASE64BINARY
public static final String BASE64BINARY
TheBASE64BINARYencoding type indicates that the encoding name given corresponds to base64 encoding of a binary value- See Also:
- Constant Field Values
-
HEXBINARY
public static final String HEXBINARY
TheHEXBINARYencoding type indicates that the encoding name given corresponds to Hex encoding of a binary value- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BinarySecurityToken
public BinarySecurityToken(X509TokenSpec tokenSpec) throws SecurityException
Constructor- Parameters:
tokenSpec- theX509TokenSpecfor generating binary security token.- Throws:
SecurityException
-
BinarySecurityToken
public BinarySecurityToken(X509Certificate cert, String valueType, String encodingType) throws SecurityException
- Throws:
SecurityException
-
BinarySecurityToken
public BinarySecurityToken(KerberosTokenSpec kbSpec) throws SecurityException
Constructor to create Kerberos Token- Parameters:
kbSpec- The Kerberos Token Specification- Throws:
SecurityException
-
BinarySecurityToken
public BinarySecurityToken(Element token) throws SecurityException
Constructor- Parameters:
token- Binary Security Token Element- Throws:
SecurityException- if token Element is not a valid binary security token
-
-
Method Detail
-
getEncodingType
public String getEncodingType()
Gets encoding type for the token.- Returns:
- encoding type for the token.
-
getValueType
public String 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.
-
getSecretKey
public Key getSecretKey()
Returns the secret key for kerberos token.- Returns:
- the secret key
-
toString
public String toString()
Returns a String representation of the token
-
getTokenType
public String getTokenType()
Returns the token type.- Specified by:
getTokenTypein interfaceSecurityToken- Returns:
- String the token type.
-
getSubjectCertAlias
public String[] getSubjectCertAlias()
Returns the array of certificate aliases defined in this spec.- Returns:
- String[] the array of subject certificate aliases.
-
getSigningId
public String getSigningId()
Returns the signing id for binary security token.- Returns:
- the signing id for the binary security token.
-
toDocumentElement
public Element toDocumentElement() throws SecurityException
Returns theDOMElement of the binary security token.- Specified by:
toDocumentElementin interfaceSecurityToken- Returns:
- Element the DOM document element of binary security token.
- Throws:
SecurityException- if the document element can not be created.
-
-