Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.security

Class KeyPair

java.lang.Object
|
+--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.

Author:

Constructor Summary

KeyPair(java.security.PublicKey publicKey, java.security.PrivateKey privateKey)

Initializes the KeyPair with a pubilc and private key.

Method Summary

java.security.PrivateKeygetPrivate()

Returns the private key stored in the KeyPair
java.security.PublicKeygetPublic()

Returns the public key stored in the KeyPair

Constructor Details

KeyPair

public KeyPair(java.security.PublicKey publicKey, java.security.PrivateKey privateKey)

Initializes the KeyPair with a pubilc and private key.

Parameters:


Method Details

getPrivate

public PrivateKey getPrivate()

Returns the private key stored in the KeyPair

Returns:


getPublic

public PublicKey getPublic()

Returns the public key stored in the KeyPair

Returns: