com.pingidentity.sts.clientapi.tokens.wsse
Class BinaryToken

java.lang.Object
  extended by com.pingidentity.sts.clientapi.tokens.wsse.BinaryToken
All Implemented Interfaces:
Token
Direct Known Subclasses:
X509CertificateToken

public class BinaryToken
extends java.lang.Object
implements Token

Implementation of a generic BinarySecurityToken to be used for custom token types. For example, the x509 token profile is implemented using BinaryToken as the base class.


Field Summary
protected static java.lang.String BINARY_SECURITY_TOKEN_QNAME
           
protected static java.lang.String ENCODING_TYPE
           
protected static java.lang.String ENCODING_TYPE_URI
           
protected  java.lang.String tokenData
           
protected static java.lang.String VALUE_TYPE
           
protected static java.lang.String WSU_ID_QNAME
           
 
Constructor Summary
BinaryToken()
           
BinaryToken(java.lang.String tokenData)
           
BinaryToken(java.lang.String tokenData, java.lang.String valueTypeUri)
           
 
Method Summary
protected  org.w3c.dom.Element createToken(java.lang.String encodedData)
          Sets the encoded data portion of the binary token.
 org.w3c.dom.Element getRoot()
          Retrieves the raw token data as an XML Element.
 java.lang.String getSubjectId()
          Not implemented since the token only contains encoded data.
 java.lang.String getTokenId()
          Retrieves the XML identifier for the XML data of the BinarySecurityToken.
 java.lang.String getValueTypeUri()
          Retrieves the value type URI of the BinarySecurityToken.
 void parse(org.w3c.dom.Element root)
          Parses the provided XML Element into a token.
 void setValueTypeUri(java.lang.String valueTypeUri)
          Sets the value type URI of the BinarySecurityToken.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINARY_SECURITY_TOKEN_QNAME

protected static final java.lang.String BINARY_SECURITY_TOKEN_QNAME
See Also:
Constant Field Values

WSU_ID_QNAME

protected static final java.lang.String WSU_ID_QNAME
See Also:
Constant Field Values

VALUE_TYPE

protected static final java.lang.String VALUE_TYPE
See Also:
Constant Field Values

ENCODING_TYPE

protected static final java.lang.String ENCODING_TYPE
See Also:
Constant Field Values

ENCODING_TYPE_URI

protected static final java.lang.String ENCODING_TYPE_URI
See Also:
Constant Field Values

tokenData

protected java.lang.String tokenData
Constructor Detail

BinaryToken

public BinaryToken()

BinaryToken

public BinaryToken(java.lang.String tokenData)

BinaryToken

public BinaryToken(java.lang.String tokenData,
                   java.lang.String valueTypeUri)
Method Detail

getRoot

public org.w3c.dom.Element getRoot()
                            throws SecurityTokenException
Description copied from interface: Token
Retrieves the raw token data as an XML Element.

Specified by:
getRoot in interface Token
Returns:
Throws:
SecurityTokenException

getSubjectId

public java.lang.String getSubjectId()
Not implemented since the token only contains encoded data. Deriving classes can override this method to provide access to the subject from the decoded token data.

Specified by:
getSubjectId in interface Token
Returns:
subject as String

parse

public void parse(org.w3c.dom.Element root)
           throws SecurityTokenException
Description copied from interface: Token
Parses the provided XML Element into a token. If a parsing error occurs, a SecurityTokenException is thrown.

Specified by:
parse in interface Token
Throws:
SecurityTokenException

getValueTypeUri

public java.lang.String getValueTypeUri()
Retrieves the value type URI of the BinarySecurityToken. This is the URI that describes the custom token type being implemented.

Returns:
value type URI as String

setValueTypeUri

public void setValueTypeUri(java.lang.String valueTypeUri)
Sets the value type URI of the BinarySecurityToken. This is the URI that describes the custom token type being implemented.

Parameters:
valueTypeUri - URI as String

createToken

protected org.w3c.dom.Element createToken(java.lang.String encodedData)
                                   throws SecurityTokenException
Sets the encoded data portion of the binary token.

Parameters:
encodedData - Base64 encoded data as String
Returns:
Element object instance containing XML data of the BinarySecurityToken
Throws:
SecurityTokenException

getTokenId

public java.lang.String getTokenId()
Retrieves the XML identifier for the XML data of the BinarySecurityToken.

Returns:
identifier as String


Copyright © 2006-2009 Ping Identity Corporation. All Rights Reserved.