All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.crypto.CryptoKeyPair

java.lang.Object
   |
   +----semper.crypto.CryptoKeyPair

public class CryptoKeyPair
extends Object
implements Serializable
CryptoKeyPair implements a datastructure containing a public key pair.

Version:
$Revision: 1.3 $ $Date: 1998/07/06 09:47:18 $
Author:
Thomas S. Nielsen (drud@cryptomathic.dk), Torben P. Pedersen (tpp@cryptomathic.dk)

Constructor Index

 o CryptoKeyPair()
Creates a new, empty key information object.
 o CryptoKeyPair(CryptoKeyInfo, CryptoKeyInfo)
Constructs a CryptoKeyPair object containing the gvien keys

Method Index

 o getPrivateKey()
Accessor method to private key.
 o getPublicKey()
Accessor method to public key.
 o retrieveSKey(CryptoKeyInfo)
Retrieves a secret key from storage corresponding to a given public key.
 o updateKeyPair()
Update the key pair.

Constructors

 o CryptoKeyPair
 public CryptoKeyPair()
Creates a new, empty key information object.

 o CryptoKeyPair
 public CryptoKeyPair(CryptoKeyInfo privateKey,
                      CryptoKeyInfo publicKey)
Constructs a CryptoKeyPair object containing the gvien keys

Parameters:
The - private key
The - corresponding public key

Methods

 o getPrivateKey
 public CryptoKeyInfo getPrivateKey()
Accessor method to private key. A copy of the key is returned.

 o getPublicKey
 public CryptoKeyInfo getPublicKey()
Accessor method to public key. A copy of the key is returned.

 o updateKeyPair
 public void updateKeyPair() throws CryptoManException
Update the key pair. The key pair should contain a public key and will try to update the pair with the secret key. If the certificate belongs to yourself, the key pair will afterwards contain both secret and public key. Otherwise the keypair will only contain the public key.

Throws: CryptoManException
if the key pair does not contain a public key
 o retrieveSKey
 public static CryptoKeyInfo retrieveSKey(CryptoKeyInfo publicKey)
Retrieves a secret key from storage corresponding to a given public key. In some cases (e.g., when the public key belongs to someone else) this does not make sense and null is returned). This is not considered an exception, as it should be clear from the context whether a key belongs to yourself or not.

Parameters:
publicKey - is the public key for which the secret key is needed
Returns:
the key corresponding to the public key (null if no key was found)

All Packages  Class Hierarchy  This Package  Previous  Next  Index