IAIK PKCS#11 Wrapper
version 1.2.17

iaik.pkcs.pkcs11.objects
Class KeyPair

java.lang.Object
  extended byiaik.pkcs.pkcs11.objects.KeyPair
All Implemented Interfaces:
Cloneable

public class KeyPair
extends Object
implements Cloneable

This class does not correspond to any PKCS#11 object. It is only a pair of a private key and a public key.

Invariants
(publicKey_ <> null) and (privateKey_ <> null)

Field Summary
protected  PrivateKey privateKey_
          The private key of this key-pair.
protected  PublicKey publicKey_
          The public key of this key-pair.
 
Constructor Summary
KeyPair(PublicKey publicKey, PrivateKey privateKey)
          Constructor that takes a public and a private key.
 
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.
 PrivateKey getPrivateKey()
          Get the private key part of this key-pair.
 PublicKey getPublicKey()
          Get the public key part of this key-pair.
 int hashCode()
          The overriding of this method should ensure that the objects of this class work correctly in a hashtable.
 void setPrivateKey(PrivateKey privateKey)
          Set the private key part of this key-pair.
 void setPublicKey(PublicKey publicKey)
          Set the public key part of this key-pair.
 String toString()
          This method returns a string representation of the current object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

publicKey_

protected PublicKey publicKey_
The public key of this key-pair.


privateKey_

protected PrivateKey privateKey_
The private key of this key-pair.

Constructor Detail

KeyPair

public KeyPair(PublicKey publicKey,
               PrivateKey privateKey)
Constructor that takes a public and a private key. None can be null.

Parameters:
publicKey - The public key of the key-pair.
privateKey - The private key of the key-pair.
Preconditions
(publicKey <> null) and (privateKey <> 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 KeyPair) and (result.equals(this))

getPublicKey

public PublicKey getPublicKey()
Get the public key part of this key-pair.

Returns:
The public key part of this key-pair.
Preconditions
Postconditions
(result <> null)

setPublicKey

public void setPublicKey(PublicKey publicKey)
Set the public key part of this key-pair.

Parameters:
publicKey - The public key part of this key-pair.
Preconditions
(publicKey <> null)
Postconditions

getPrivateKey

public PrivateKey getPrivateKey()
Get the private key part of this key-pair.

Returns:
The private key part of this key-pair.
Preconditions
Postconditions
(result <> null)

setPrivateKey

public void setPrivateKey(PrivateKey privateKey)
Set the private key part of this key-pair.

Parameters:
privateKey - The private key part of this key-pair.
Preconditions
(privateKey <> null)
Postconditions

toString

public String toString()
This method returns a string representation of the current object. The output is only for debugging purposes and should not be used for other purposes.

Returns:
A string presentation of this object for debugging output.
Preconditions
Postconditions
(result <> null)

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.