public class KeyPair
extends java.lang.Object
| Constructor and Description |
|---|
KeyPair()
Creates a random key pair.
|
KeyPair(PrivateKey privateKey)
Creates a key pair around a private key.
|
KeyPair(PrivateKey privateKey,
CryptoEngine engine)
Creates a key pair around a private key.
|
KeyPair(PublicKey publicKey)
Creates a key pair around a public key.
|
KeyPair(PublicKey publicKey,
CryptoEngine engine)
Creates a key pair around a public key.
|
| Modifier and Type | Method and Description |
|---|---|
PrivateKey |
getPrivateKey()
Gets the private key.
|
PublicKey |
getPublicKey()
Gets the public key.
|
boolean |
hasPrivateKey()
Determines if the current key pair has a private key.
|
static KeyPair |
random(CryptoEngine engine)
Creates a random key pair that is compatible with the specified engine.
|
public KeyPair()
public KeyPair(PrivateKey privateKey)
privateKey - The private key.public KeyPair(PrivateKey privateKey, CryptoEngine engine)
privateKey - The private key.engine - The crypto engine.public KeyPair(PublicKey publicKey)
publicKey - The public key.public KeyPair(PublicKey publicKey, CryptoEngine engine)
publicKey - The public key.engine - The crypto engine.public static KeyPair random(CryptoEngine engine)
engine - The crypto engine.public PrivateKey getPrivateKey()
public PublicKey getPublicKey()
public boolean hasPrivateKey()