java.security
Class KeyPair

java.lang.Object
  extended by java.security.KeyPair
All Implemented Interfaces:
Serializable

public final class KeyPair
extends Object
implements Serializable

KeyPair serves as a simple container for public and private keys. If properly initialized, this class should be treated like the private key since it contains it and take approriate security measures.

See Also:
Serialized Form

Constructor Summary
KeyPair(PublicKey publicKey, PrivateKey privateKey)
          Initializes the KeyPair with a pubilc and private key.
 
Method Summary
 PrivateKey getPrivate()
          Returns the private key stored in the KeyPair
 PublicKey getPublic()
          Returns the public key stored in the KeyPair
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyPair

public KeyPair(PublicKey publicKey,
               PrivateKey privateKey)
Initializes the KeyPair with a pubilc and private key.

Parameters:
publicKey - Public Key to store
privateKey - Private Key to store
Method Detail

getPublic

public PublicKey getPublic()
Returns the public key stored in the KeyPair

Returns:
The public key

getPrivate

public PrivateKey getPrivate()
Returns the private key stored in the KeyPair

Returns:
The private key