public class KeyPair
extends java.lang.Object
implements java.io.Externalizable
| Constructor and Description |
|---|
KeyPair()
Creates a new empty instance.
|
KeyPair(PublicKey publicKey, PrivateKey privateKey)
Creates a new key pair.
|
| Modifier and Type | Method and Description |
|---|---|
PrivateKey |
getPrivate()
Returns the private key.
|
PublicKey |
getPublic()
Returns the public key.
|
void |
readExternal(java.io.ObjectInput is)
Reads the input stream and initializes the key pair.
|
void |
setPrivate(PrivateKey privateKey)
Sets the private key.
|
void |
setPublic(PublicKey publicKey)
Sets the public key.
|
void |
writeExternal(java.io.ObjectOutput os)
Writes to the output stream the DER encoding of this object.
|
public KeyPair()
public KeyPair(PublicKey publicKey, PrivateKey privateKey)
public PublicKey getPublic()
public void setPublic(PublicKey publicKey)
public PrivateKey getPrivate()
public void setPrivate(PrivateKey privateKey)
public void writeExternal(java.io.ObjectOutput os)
throws java.io.IOException
writeExternal in interface java.io.Externalizableos - The output stream to write the encoding to.java.io.IOException
public void readExternal(java.io.ObjectInput is)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizableis - The stream to read from.java.io.IOExceptionjava.lang.ClassNotFoundException