com.rsa.swsj.profiles.wss
Class SecurityTokenReference

java.lang.Object
  extended bycom.rsa.swsj.profiles.wss.SecurityTokenReference
All Implemented Interfaces:
KeyInfo

public final class SecurityTokenReference
extends java.lang.Object
implements KeyInfo

An implementation of the <SecurityTokenReference> element.

A <SecurityTokenReference> contains one of two types of references to key data. The first reference type is a direct reference, which simply points to the XML element containing the key data. This type of reference is usually a X.509 security token in the SOAP message security header. The second reference type is a KeyIdentifier, which contains necessary information for identifying the key.

When creating a SecurityTokenReference object, a token is attached to the WSSParameters or a security operation.


Field Summary

static int

DIRECT_REFERENCE

Specifies that this token reference points directly to XML element containing the key data.

static int

KEY_IDENTIFIER

Specifies that this token reference contains key identifier information.

 
Constructor Summary
SecurityTokenReference(SWSJContext context)

Creates an empty SecurityTokenReference object initialized only with context.

 
Method Summary

 SWSJContext

getContext()

Gets the SWSJContext.

 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.

 KeyIdentifier

getKeyIdentifier()

Gets the Key identifier.

 int

getType()

Returns an integer specifying the type of token reference.

 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

setKeyIdentifier(KeyIdentifier identifier)

Sets the Key identifier.

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

Field Detail

DIRECT_REFERENCE

public static final int DIRECT_REFERENCE
Specifies that this token reference points directly to XML element containing the key data.

See Also:
Constant Field Values

KEY_IDENTIFIER

public static final int KEY_IDENTIFIER
Specifies that this token reference contains key identifier information.

See Also:
Constant Field Values
Constructor Detail

SecurityTokenReference

public SecurityTokenReference(SWSJContext context)
                       throws InvalidParameterException
Creates an empty SecurityTokenReference 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.

Specified by:
getContext in interface KeyInfo
Returns:
The toolkit context

setKeyIdentifier

public void setKeyIdentifier(KeyIdentifier identifier)
Sets the Key identifier.

Parameters:
identifier - The Key identifier.

getKeyIdentifier

public KeyIdentifier getKeyIdentifier()
Gets the Key identifier.

Returns:
The Key identifier.

getType

public int getType()
Returns an integer specifying the type of token reference.

Returns:
Either DIRECT_REFERENCE or KEY_IDENTIFIER.

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 or null.

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.