Bouncy Castle Cryptography Library 1.49

org.bouncycastle.openpgp
Class PGPPrivateKey

java.lang.Object
  extended by org.bouncycastle.openpgp.PGPPrivateKey
Direct Known Subclasses:
JcaPGPPrivateKey

public class PGPPrivateKey
extends java.lang.Object

general class to contain a private key for use with other openPGP objects.


Constructor Summary
PGPPrivateKey(long keyID, PublicKeyPacket publicKeyPacket, BCPGKey privateKeyDataPacket)
          Base constructor.
PGPPrivateKey(java.security.PrivateKey privateKey, long keyID)
          Deprecated. use JcaPGPKeyConverter
 
Method Summary
 java.security.PrivateKey getKey()
          Deprecated. use a JcaPGPKeyConverter
 long getKeyID()
          Return the keyID associated with the contained private key.
 BCPGKey getPrivateKeyDataPacket()
          Return the private key packet associated with this private key, if available.
 PublicKeyPacket getPublicKeyPacket()
          Return the public key packet associated with this private key, if available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPPrivateKey

public PGPPrivateKey(java.security.PrivateKey privateKey,
                     long keyID)
Deprecated. use JcaPGPKeyConverter

Create a PGPPrivateKey from a regular private key and the keyID of its associated public key.

Parameters:
privateKey - private key tu use.
keyID - keyID of the corresponding public key.

PGPPrivateKey

public PGPPrivateKey(long keyID,
                     PublicKeyPacket publicKeyPacket,
                     BCPGKey privateKeyDataPacket)
Base constructor. Create a PGPPrivateKey from a keyID and the associated public/private data packets needed to fully describe it.

Parameters:
keyID - keyID associated with the public key.
publicKeyPacket - the public key data packet to be associated with this private key.
privateKeyDataPacket - the private key data packet to be associate with this private key.
Method Detail

getKeyID

public long getKeyID()
Return the keyID associated with the contained private key.

Returns:
long

getKey

public java.security.PrivateKey getKey()
Deprecated. use a JcaPGPKeyConverter

Return the contained private key.

Returns:
PrivateKey

getPublicKeyPacket

public PublicKeyPacket getPublicKeyPacket()
Return the public key packet associated with this private key, if available.

Returns:
associated public key packet, null otherwise.

getPrivateKeyDataPacket

public BCPGKey getPrivateKeyDataPacket()
Return the private key packet associated with this private key, if available.

Returns:
associated private key packet, null otherwise.

Bouncy Castle Cryptography Library 1.49