public final class KeyPair extends Object implements Serializable
KeyPair is a container for a public key and a private key. Since the
private key can be accessed, instances must be treated like a private key.PrivateKey,
PublicKey,
Serialized Form| Constructor and Description |
|---|
KeyPair(PublicKey publicKey,
PrivateKey privateKey)
Constructs a new instance of
KeyPair with a public key and the
corresponding private key. |
| Modifier and Type | Method and Description |
|---|---|
PrivateKey |
getPrivate()
Returns the private key.
|
PublicKey |
getPublic()
Returns the public key.
|
public KeyPair(PublicKey publicKey, PrivateKey privateKey)
KeyPair with a public key and the
corresponding private key.publicKey - the public key.privateKey - the private key.public PrivateKey getPrivate()
public PublicKey getPublic()