com.rsa.swsj
Class KeyValue

java.lang.Object
  extended bycom.rsa.swsj.KeyValue
All Implemented Interfaces:
KeyInfo

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

This class builds and stores a KeyValue element in KeyInfo. It contains the key that validates signatures and encryption.


Constructor Summary
KeyValue(SWSJContext context)

Creates an empty KeyValue object initialized only with context.

KeyValue(SWSJContext context, java.security.PublicKey publicKey)

Creates a KeyValue object, sets the context, and initializes the key to publicKey.

 
Method Summary

 SWSJContext

getContext()

Gets the SWSJContext.

 java.security.PublicKey

getKey()

Returns the public key.

 void

setKey(java.security.PublicKey publicKey)

Sets the public-key values of this KeyValue object.

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

Constructor Detail

KeyValue

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

KeyValue

public KeyValue(SWSJContext context,
                java.security.PublicKey publicKey)
         throws InvalidParameterException
Creates a KeyValue object, sets the context, and initializes the key to publicKey.

Parameters:
context - An object that collects a number of common parameters and state variables; for example, JCE provider.
publicKey - A PublicKey object that contains the key to use.
Throws:
InvalidParameterException - If any parameters are invalid.
Method Detail

getContext

public SWSJContext getContext()
Gets the SWSJContext.

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

setKey

public void setKey(java.security.PublicKey publicKey)
            throws InvalidParameterException
Sets the public-key values of this KeyValue object.

Parameters:
publicKey - The public key used to perform the security operation as a PublicKey object.
Throws:
InvalidParameterException - If publicKey is invalid.

getKey

public java.security.PublicKey getKey()
Returns the public key.

Returns:
The key used to validate the signature or encryption, as a PublicKey.