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 ([email protected]), Torben P. Pedersen ([email protected])
-
CryptoKeyPair()
- Creates a new, empty key information object.
-
CryptoKeyPair(CryptoKeyInfo, CryptoKeyInfo)
- Constructs a CryptoKeyPair object containing the gvien keys
-
getPrivateKey()
- Accessor method to private key.
-
getPublicKey()
- Accessor method to public key.
-
retrieveSKey(CryptoKeyInfo)
- Retrieves a secret key from storage corresponding to a given public key.
-
updateKeyPair()
-
Update the key pair.
CryptoKeyPair
public CryptoKeyPair()
- Creates a new, empty key information object.
CryptoKeyPair
public CryptoKeyPair(CryptoKeyInfo privateKey,
CryptoKeyInfo publicKey)
- Constructs a CryptoKeyPair object containing the gvien keys
- Parameters:
- The - private key
- The - corresponding public key
getPrivateKey
public CryptoKeyInfo getPrivateKey()
- Accessor method to private key. A copy of the key is returned.
getPublicKey
public CryptoKeyInfo getPublicKey()
- Accessor method to public key. A copy of the key is returned.
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
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