public class PGPKeyPair
extends java.lang.Object
A word for the unwary, the KeyID for a OpenPGP public key is calculated from a hash that includes the time of creation, if you pass a different date to the constructor below with the same public private key pair the KeyID will not be the same as for previous generations of the key, so ideally you only want to do this once.
Modifier and Type | Field and Description |
---|---|
protected PGPPrivateKey |
priv |
protected PGPPublicKey |
pub |
Modifier | Constructor and Description |
---|---|
protected |
PGPKeyPair() |
|
PGPKeyPair(int algorithm,
java.security.KeyPair keyPair,
java.util.Date time)
Deprecated.
use BcPGPKeyPair or JcaPGPKeyPair as appropriate.
|
|
PGPKeyPair(int algorithm,
java.security.KeyPair keyPair,
java.util.Date time,
java.lang.String provider)
Deprecated.
use BcPGPKeyPair or JcaPGPKeyPair as appropriate.
|
|
PGPKeyPair(int algorithm,
java.security.PublicKey pubKey,
java.security.PrivateKey privKey,
java.util.Date time)
Deprecated.
use BcPGPKeyPair or JcaPGPKeyPair as appropriate.
|
|
PGPKeyPair(int algorithm,
java.security.PublicKey pubKey,
java.security.PrivateKey privKey,
java.util.Date time,
java.lang.String provider)
Deprecated.
use BcPGPKeyPair or JcaPGPKeyPair as appropriate.
|
|
PGPKeyPair(PGPPublicKey pub,
PGPPrivateKey priv)
Create a key pair from a PGPPrivateKey and a PGPPublicKey.
|
Modifier and Type | Method and Description |
---|---|
long |
getKeyID()
Return the keyID associated with this key pair.
|
PGPPrivateKey |
getPrivateKey() |
PGPPublicKey |
getPublicKey() |
protected PGPPublicKey pub
protected PGPPrivateKey priv
public PGPKeyPair(int algorithm, java.security.KeyPair keyPair, java.util.Date time, java.lang.String provider) throws PGPException, java.security.NoSuchProviderException
PGPException
java.security.NoSuchProviderException
public PGPKeyPair(int algorithm, java.security.KeyPair keyPair, java.util.Date time) throws PGPException
PGPException
public PGPKeyPair(int algorithm, java.security.PublicKey pubKey, java.security.PrivateKey privKey, java.util.Date time, java.lang.String provider) throws PGPException, java.security.NoSuchProviderException
PGPException
java.security.NoSuchProviderException
public PGPKeyPair(int algorithm, java.security.PublicKey pubKey, java.security.PrivateKey privKey, java.util.Date time) throws PGPException
PGPException
public PGPKeyPair(PGPPublicKey pub, PGPPrivateKey priv)
pub
- the public keypriv
- the private keyprotected PGPKeyPair()
public long getKeyID()
public PGPPublicKey getPublicKey()
public PGPPrivateKey getPrivateKey()