Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public Class PGPKeyPair

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyPair

General class to handle JCA key pairs and convert them into OpenPGP ones.

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.

Field Summary

Modifier and TypeField and Description
protected PGPPrivateKey
protected PGPPublicKey

Constructor Summary

AccessConstructor and Description
public
PGPKeyPair(PGPPublicKey
the public key
pub
,
PGPPrivateKey
the private key
priv
)

Create a key pair from a PGPPrivateKey and a PGPPublicKey.

protected

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

keyID
getKeyID
()

Return the keyID associated with this key pair.

public PGPPrivateKey
public PGPPublicKey
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

privback to summary
protected PGPPrivateKey priv
pubback to summary
protected PGPPublicKey pub

Constructor Detail

PGPKeyPairback to summary
public PGPKeyPair(PGPPublicKey pub, PGPPrivateKey priv)

Create a key pair from a PGPPrivateKey and a PGPPublicKey.

Parameters
pub:PGPPublicKey

the public key

priv:PGPPrivateKey

the private key

PGPKeyPairback to summary
protected PGPKeyPair()

Method Detail

getKeyIDback to summary
public long getKeyID()

Return the keyID associated with this key pair.

Returns:long

keyID

getPrivateKeyback to summary
public PGPPrivateKey getPrivateKey()
getPublicKeyback to summary
public PGPPublicKey getPublicKey()