com.rsa.swsj.profiles.wss
Class KeyIdentifier

java.lang.Object
  extended bycom.rsa.swsj.profiles.wss.KeyIdentifier

public final class KeyIdentifier
extends java.lang.Object

An implementation of the <KeyIdentifier> element. A key identifier is a value that uniquely identifies a key.


Field Summary

static java.lang.String

BASE64_ENCODING_TYPE

String that indicates an EncodingType attribute is Base64.

static java.lang.String

X509SKI_TYPE_VALUE

A String that indicates a ValueType attribute value is an X.509 subject key identifier.

 
Constructor Summary
KeyIdentifier(SWSJContext context)

Creates an empty KeyIdentifier object initialized only with context.

 
Method Summary

 SWSJContext

getContext()

Gets the SWSJContext.

 java.lang.String

getEncodingType()

Returns the encoding type of the key identifier.

 java.lang.String

getId()

Gets the Id attribute that provides a standard method to assign a string ID to an element within the document context.

 byte[]

getValue()

Gets the value of this KeyIdentifier.

 java.lang.String

getValueType()

Gets the type of KeyIdentifier being used.

 void

setEncodingType(java.lang.String encodingType)

Sets the type of encoding used to encode the KeyIdentifier.

 void

setId(java.lang.String id)

Sets the Id attribute that provides a standard method to assign a string ID to an element within the document context.

 void

setValue(byte[] value)

Sets the value of this KeyIdentifier.

 void

setValueType(java.lang.String valueType)

Sets the type of KeyIdentifier being used.

 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X509SKI_TYPE_VALUE

public static final java.lang.String X509SKI_TYPE_VALUE
A String that indicates a ValueType attribute value is an X.509 subject key identifier.

See Also:
Constant Field Values

BASE64_ENCODING_TYPE

public static final java.lang.String BASE64_ENCODING_TYPE
String that indicates an EncodingType attribute is Base64.

See Also:
Constant Field Values
Constructor Detail

KeyIdentifier

public KeyIdentifier(SWSJContext context)
              throws InvalidParameterException
Creates an empty KeyIdentifier object initialized only with context.

Parameters:
context - An object that collects a number of common parameters and state variables; for example, JCE provider.
Throws:
InvalidParameterException - If context is invalid.
Method Detail

getContext

public SWSJContext getContext()
Gets the SWSJContext.

Returns:
The toolkit context

setId

public void setId(java.lang.String id)
           throws InvalidParameterException
Sets the Id attribute that provides a standard method to assign a string ID to an element within the document context.

Note: It is the user's responsibility not to duplicate ID values in XML and WSS documents to which security will be added.

Parameters:
id - The ID.
Throws:
InvalidParameterException - If id is invalid.

getId

public java.lang.String getId()
Gets the Id attribute that provides a standard method to assign a string ID to an element within the document context.

Returns:
The Id attribute.

setValueType

public void setValueType(java.lang.String valueType)
                  throws InvalidParameterException
Sets the type of KeyIdentifier being used. Each token profile specifies the KeyIdentifier types that may be used to refer to tokens of that type.

Parameters:
valueType - Type of value referred to by this key identifier. The only supported values is KeyIdentifier.X509SKI_TYPE_VALUE.
Throws:
InvalidParameterException - If valueType is invalid.

getValueType

public java.lang.String getValueType()
Gets the type of KeyIdentifier being used. Each token profile specifies the KeyIdentifier types that can refer to tokens of that type.

Returns:
The type of value referred to by this key identifier.

setEncodingType

public void setEncodingType(java.lang.String encodingType)
                     throws InvalidParameterException
Sets the type of encoding used to encode the KeyIdentifier. Only Base64 encoding is currently supported.

Parameters:
encodingType - Type of encoding used for this key identifier. The only supported values is KeyIdentifier.BASE64_ENCODING_TYPE.
Throws:
InvalidParameterException - If encodingType is invalid.

getEncodingType

public java.lang.String getEncodingType()
Returns the encoding type of the key identifier.

Returns:
A String value that specifies the encoding. As Base64Binary is only the type currently supported, this method always returns a Base64Binary type.

setValue

public void setValue(byte[] value)
              throws InvalidParameterException
Sets the value of this KeyIdentifier.

Parameters:
value - A byte array containing the data to be included in this key identifier.
Throws:
InvalidParameterException - If value is invalid.

getValue

public byte[] getValue()
Gets the value of this KeyIdentifier.

Returns:
A byte array containing the data included in this key identifier.