IAIK PKCS#11 Wrapper
version 1.2.17

iaik.pkcs.pkcs11.parameters
Class SSL3KeyMaterialOutParameters

java.lang.Object
  extended byiaik.pkcs.pkcs11.parameters.SSL3KeyMaterialOutParameters
All Implemented Interfaces:
Cloneable, Parameters

public class SSL3KeyMaterialOutParameters
extends Object
implements Parameters

Objects of this class encapsulates key material output for the mechanism Mechanism.SSL3_KEY_AND_MAC_DERIVE.

Invariants

Field Summary
protected  byte[] clientIV_
          The initialization vector (IV) created for the client (if any).
protected  SecretKey clientKey_
          The resulting Client Secret key.
protected  SecretKey clientMacSecret_
          The resulting Client MAC Secret key.
protected  byte[] serverIV_
          The initialization vector (IV) created for the server (if any).
protected  SecretKey serverKey_
          The resulting Server Secret key.
protected  SecretKey serverMacSecret_
          The resulting Server MAC Secret key.
 
Constructor Summary
SSL3KeyMaterialOutParameters(byte[] clientIV, byte[] serverIV)
          Create a new SSL3KeyMaterialOutParameters object.
 
Method Summary
 Object clone()
          Create a (deep) clone of this object.
 boolean equals(Object otherObject)
          Compares all member variables of this object with the other object.
 byte[] getClientIV()
          Get the resulting client initialization vector.
 SecretKey getClientMacSecret()
          Get the resulting client MAC secret key.
 SecretKey getClientSecret()
          Get the resulting client secret key.
 Object getPKCS11ParamsObject()
          Get this parameters object as an object of the CK_SSL3_KEY_MAT_OUT class.
 byte[] getServerIV()
          Get the resulting server initialization vector.
 SecretKey getServerMacSecret()
          Get the resulting server MAC secret key.
 SecretKey getServerSecret()
          Get the resulting server secret key.
 int hashCode()
          The overriding of this method should ensure that the objects of this class work correctly in a hashtable.
 void setPKCS11ParamsObject(CK_SSL3_KEY_MAT_OUT input, Session session)
          This method takes the key handles from the given input structure, which will be the result after a call to DeriveKey, and creates the SecretKey objects for this object.
 String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

clientMacSecret_

protected SecretKey clientMacSecret_
The resulting Client MAC Secret key.


serverMacSecret_

protected SecretKey serverMacSecret_
The resulting Server MAC Secret key.


clientKey_

protected SecretKey clientKey_
The resulting Client Secret key.


serverKey_

protected SecretKey serverKey_
The resulting Server Secret key.


clientIV_

protected byte[] clientIV_
The initialization vector (IV) created for the client (if any).


serverIV_

protected byte[] serverIV_
The initialization vector (IV) created for the server (if any).

Constructor Detail

SSL3KeyMaterialOutParameters

public SSL3KeyMaterialOutParameters(byte[] clientIV,
                                    byte[] serverIV)
Create a new SSL3KeyMaterialOutParameters object. It does not take any parameters, because they user does not need to set any of them. The token sets all of them, after a call to DeriveKey using the mechanism Mechanism.SSL3_KEY_AND_MAC_DERIVE. After the call to deriveKey, the members of this object will hold the generated keys and IVs.

Parameters:
clientIV - The buffer for the client initialization vector.
serverIV - The buffer for the server initialization vector.
Preconditions
(clientIV <> null) and (serverIV <> null)
Postconditions
Method Detail

clone

public Object clone()
Create a (deep) clone of this object.

Returns:
A clone of this object.
Preconditions
Postconditions
(result <> null) and (result instanceof SSL3KeyMaterialOutParameters) and (result.equals(this))

getPKCS11ParamsObject

public Object getPKCS11ParamsObject()
Get this parameters object as an object of the CK_SSL3_KEY_MAT_OUT class.

Specified by:
getPKCS11ParamsObject in interface Parameters
Returns:
This object as a CK_SSL3_KEY_MAT_OUT object.
Preconditions
Postconditions
(result <> null)

setPKCS11ParamsObject

public void setPKCS11ParamsObject(CK_SSL3_KEY_MAT_OUT input,
                                  Session session)
                           throws TokenException
This method takes the key handles from the given input structure, which will be the result after a call to DeriveKey, and creates the SecretKey objects for this object. It also reads the IVs.

Parameters:
input - The structure that holds the necessary key handles and IVs.
session - The session to use for reading attributes. This session must have the appropriate rights; i.e. it must be a user-session, if it is a private object.
Throws:
TokenException - If reading the secret key object attributes fails.
Preconditions
(input <> null) and (session <> null)
Postconditions

getClientMacSecret

public SecretKey getClientMacSecret()
Get the resulting client MAC secret key.

Returns:
The resulting client MAC secret key.
Preconditions
Postconditions
(result == null)

getServerMacSecret

public SecretKey getServerMacSecret()
Get the resulting server MAC secret key.

Returns:
The resulting server MAC secret key.
Preconditions
Postconditions
(result == null)

getClientSecret

public SecretKey getClientSecret()
Get the resulting client secret key.

Returns:
The resulting client secret key.
Preconditions
Postconditions
(result == null)

getServerSecret

public SecretKey getServerSecret()
Get the resulting server secret key.

Returns:
The resulting server secret key.
Preconditions
Postconditions
(result == null)

getClientIV

public byte[] getClientIV()
Get the resulting client initialization vector.

Returns:
The resulting client initialization vector.
Preconditions
Postconditions

getServerIV

public byte[] getServerIV()
Get the resulting server initialization vector.

Returns:
The resulting server initialization vector.
Preconditions
Postconditions

toString

public String toString()
Returns the string representation of this object. Do not parse data from this string, it is for debugging only.

Returns:
A string representation of this object.

equals

public boolean equals(Object otherObject)
Compares all member variables of this object with the other object. Returns only true, if all are equal in both objects.

Parameters:
otherObject - The other object to compare to.
Returns:
True, if other is an instance of this class and all member variables of both objects are equal. False, otherwise.
Preconditions
Postconditions

hashCode

public int hashCode()
The overriding of this method should ensure that the objects of this class work correctly in a hashtable.

Returns:
The hash code of this object.
Preconditions
Postconditions

IAIK PKCS#11 Wrapper
version 1.2.17

IAIK JavaSecurity Website http://jce.iaik.tugraz.at/

IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2002, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.