Package org.bouncycastle.openpgp
Class PGPPrivateKey
- java.lang.Object
-
- org.bouncycastle.openpgp.PGPPrivateKey
-
- Direct Known Subclasses:
JcaPGPPrivateKey
public class PGPPrivateKey extends java.lang.Objectgeneral class to contain a private key for use with other openPGP objects.
-
-
Constructor Summary
Constructors Constructor Description PGPPrivateKey(long keyID, PublicKeyPacket publicKeyPacket, BCPGKey privateKeyDataPacket)Base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetKeyID()Return the keyID associated with the contained private key.KeyIdentifiergetKeyIdentifier(KeyFingerPrintCalculator fingerprintCalculator)BCPGKeygetPrivateKeyDataPacket()Return the private key packet associated with this private key, if available.PublicKeyPacketgetPublicKeyPacket()Return the public key packet associated with this private key, if available.
-
-
-
Constructor Detail
-
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
-
getKeyIdentifier
public KeyIdentifier getKeyIdentifier(KeyFingerPrintCalculator fingerprintCalculator) throws PGPException
- Throws:
PGPException
-
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.
-
-