Package | Description |
---|---|
org.bouncycastle.openpgp |
High level classes for dealing with OpenPGP objects.
|
org.bouncycastle.openpgp.examples |
Examples of use of the org.bouncycastle.openpgp package.
|
Modifier and Type | Class and Description |
---|---|
class |
PGPDataValidationException
Thrown if the iv at the start of a data stream indicates the wrong key
is being used.
|
class |
PGPKeyValidationException
Thrown if the key checksum is invalid.
|
Modifier and Type | Method and Description |
---|---|
void |
PGPEncryptedDataGenerator.addMethod(char[] passPhrase)
Add a PBE encryption method to the encrypted object using the default algorithm (S2K_SHA1).
|
void |
PGPEncryptedDataGenerator.addMethod(char[] passPhrase,
int s2kDigest)
Add a PBE encryption method to the encrypted object.
|
void |
PGPEncryptedDataGenerator.addMethod(PGPPublicKey key)
Add a public key encrypted session key to the encrypted object.
|
void |
PGPKeyRingGenerator.addSubKey(PGPKeyPair keyPair)
Add a sub key to the key ring to be generated with default certification and inheriting
the hashed/unhashed packets of the master key.
|
void |
PGPKeyRingGenerator.addSubKey(PGPKeyPair keyPair,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks)
Add a subkey with specific hashed and unhashed packets associated with it and default
certification.
|
boolean |
PGPSecretKeyRingCollection.contains(long keyID)
Return true if a key matching the passed in key ID is present, false otherwise.
|
boolean |
PGPPublicKeyRingCollection.contains(long keyID)
Return true if a key matching the passed in key ID is present, false otherwise.
|
static PGPSecretKey |
PGPSecretKey.copyWithNewPassword(PGPSecretKey key,
char[] oldPassPhrase,
char[] newPassPhrase,
int newEncAlgorithm,
java.security.SecureRandom rand,
java.security.Provider provider)
Return a copy of the passed in secret key, encrypted using a new
password and the passed in algorithm.
|
static PGPSecretKey |
PGPSecretKey.copyWithNewPassword(PGPSecretKey key,
char[] oldPassPhrase,
char[] newPassPhrase,
int newEncAlgorithm,
java.security.SecureRandom rand,
java.lang.String provider)
Return a copy of the passed in secret key, encrypted using a new
password and the passed in algorithm.
|
static PGPSecretKeyRing |
PGPSecretKeyRing.copyWithNewPassword(PGPSecretKeyRing ring,
char[] oldPassPhrase,
char[] newPassPhrase,
int newEncAlgorithm,
java.security.SecureRandom rand,
java.security.Provider provider)
Return a copy of the passed in secret key ring, with the master key and sub keys encrypted
using a new password and the passed in algorithm.
|
static PGPSecretKeyRing |
PGPSecretKeyRing.copyWithNewPassword(PGPSecretKeyRing ring,
char[] oldPassPhrase,
char[] newPassPhrase,
int newEncAlgorithm,
java.security.SecureRandom rand,
java.lang.String provider)
Return a copy of the passed in secret key ring, with the master key and sub keys encrypted
using a new password and the passed in algorithm.
|
PGPPrivateKey |
PGPSecretKey.extractPrivateKey(char[] passPhrase,
java.security.Provider provider)
Extract a PGPPrivate key from the SecretKey's encrypted contents.
|
PGPPrivateKey |
PGPSecretKey.extractPrivateKey(char[] passPhrase,
java.lang.String provider)
Extract a PGPPrivate key from the SecretKey's encrypted contents.
|
PGPSignature |
PGPV3SignatureGenerator.generate()
Return a V3 signature object containing the current signature state.
|
PGPSignature |
PGPSignatureGenerator.generate()
Return a signature object containing the current signature state.
|
PGPSignature |
PGPSignatureGenerator.generateCertification(PGPPublicKey pubKey)
Generate a certification, such as a revocation, for the passed in key.
|
PGPSignature |
PGPSignatureGenerator.generateCertification(PGPPublicKey masterKey,
PGPPublicKey pubKey)
Generate a certification for the passed in key against the passed in
master key.
|
PGPSignature |
PGPSignatureGenerator.generateCertification(PGPUserAttributeSubpacketVector userAttributes,
PGPPublicKey pubKey)
Generate a certification for the passed in userAttributes
|
PGPSignature |
PGPSignatureGenerator.generateCertification(java.lang.String id,
PGPPublicKey pubKey)
Generate a certification for the passed in id and key.
|
PGPOnePassSignature |
PGPV3SignatureGenerator.generateOnePassVersion(boolean isNested)
Return the one pass header associated with the current signature.
|
PGPOnePassSignature |
PGPSignatureGenerator.generateOnePassVersion(boolean isNested)
Return the one pass header associated with the current signature.
|
java.io.InputStream |
PGPCompressedData.getDataStream()
Return an uncompressed input stream which allows reading of the
compressed data.
|
java.io.InputStream |
PGPPBEEncryptedData.getDataStream(char[] passPhrase,
java.security.Provider provider)
Return the decrypted input stream, using the passed in passPhrase.
|
java.io.InputStream |
PGPPBEEncryptedData.getDataStream(char[] passPhrase,
java.lang.String provider)
Return the decrypted input stream, using the passed in passPhrase.
|
java.io.InputStream |
PGPPublicKeyEncryptedData.getDataStream(PGPPrivateKey privKey,
java.security.Provider provider) |
java.io.InputStream |
PGPPublicKeyEncryptedData.getDataStream(PGPPrivateKey privKey,
java.security.Provider asymProvider,
java.security.Provider provider) |
java.io.InputStream |
PGPPublicKeyEncryptedData.getDataStream(PGPPrivateKey privKey,
java.lang.String provider)
Return the decrypted data stream for the packet.
|
java.io.InputStream |
PGPPublicKeyEncryptedData.getDataStream(PGPPrivateKey privKey,
java.lang.String asymProvider,
java.lang.String provider)
Return the decrypted data stream for the packet.
|
java.security.PublicKey |
PGPPublicKey.getKey(java.security.Provider provider) |
java.security.PublicKey |
PGPPublicKey.getKey(java.lang.String provider)
Return the public key contained in the object.
|
java.util.Iterator |
PGPSecretKeyRingCollection.getKeyRings(java.lang.String userID)
Return an iterator of the key rings associated with the passed in userID.
|
java.util.Iterator |
PGPPublicKeyRingCollection.getKeyRings(java.lang.String userID)
Return an iterator of the key rings associated with the passed in userID.
|
java.util.Iterator |
PGPSecretKeyRingCollection.getKeyRings(java.lang.String userID,
boolean matchPartial)
Return an iterator of the key rings associated with the passed in userID.
|
java.util.Iterator |
PGPPublicKeyRingCollection.getKeyRings(java.lang.String userID,
boolean matchPartial)
Return an iterator of the key rings associated with the passed in userID.
|
java.util.Iterator |
PGPSecretKeyRingCollection.getKeyRings(java.lang.String userID,
boolean matchPartial,
boolean ignoreCase)
Return an iterator of the key rings associated with the passed in userID.
|
java.util.Iterator |
PGPPublicKeyRingCollection.getKeyRings(java.lang.String userID,
boolean matchPartial,
boolean ignoreCase)
Return an iterator of the key rings associated with the passed in userID.
|
PGPPublicKey |
PGPPublicKeyRingCollection.getPublicKey(long keyID)
Return the PGP public key associated with the given key id.
|
PGPPublicKeyRing |
PGPPublicKeyRingCollection.getPublicKeyRing(long keyID)
Return the public key ring which contains the key referred to by keyID.
|
PGPSecretKey |
PGPSecretKeyRingCollection.getSecretKey(long keyID)
Return the PGP secret key associated with the given key id.
|
PGPSecretKeyRing |
PGPSecretKeyRingCollection.getSecretKeyRing(long keyID)
Return the secret key ring which contains the key referred to by keyID.
|
byte[] |
PGPSignature.getSignature() |
int |
PGPPublicKeyEncryptedData.getSymmetricAlgorithm(PGPPrivateKey privKey,
java.security.Provider provider) |
int |
PGPPublicKeyEncryptedData.getSymmetricAlgorithm(PGPPrivateKey privKey,
java.lang.String provider)
Return the algorithm code for the symmetric algorithm used to encrypt the data.
|
void |
PGPV3SignatureGenerator.initSign(int signatureType,
PGPPrivateKey key)
Initialise the generator for signing.
|
void |
PGPSignatureGenerator.initSign(int signatureType,
PGPPrivateKey key)
Initialise the generator for signing.
|
void |
PGPV3SignatureGenerator.initSign(int signatureType,
PGPPrivateKey key,
java.security.SecureRandom random)
Initialise the generator for signing.
|
void |
PGPSignatureGenerator.initSign(int signatureType,
PGPPrivateKey key,
java.security.SecureRandom random)
Initialise the generator for signing.
|
void |
PGPSignature.initVerify(PGPPublicKey pubKey,
java.security.Provider provider) |
void |
PGPOnePassSignature.initVerify(PGPPublicKey pubKey,
java.security.Provider provider)
Initialise the signature object for verification.
|
void |
PGPSignature.initVerify(PGPPublicKey pubKey,
java.lang.String provider) |
void |
PGPOnePassSignature.initVerify(PGPPublicKey pubKey,
java.lang.String provider)
Initialise the signature object for verification.
|
static javax.crypto.SecretKey |
PGPUtil.makeKeyFromPassPhrase(int algorithm,
char[] passPhrase,
java.lang.String provider) |
static javax.crypto.SecretKey |
PGPUtil.makeKeyFromPassPhrase(int algorithm,
S2K s2k,
char[] passPhrase,
java.security.Provider provider) |
static javax.crypto.SecretKey |
PGPUtil.makeKeyFromPassPhrase(int algorithm,
S2K s2k,
char[] passPhrase,
java.lang.String provider) |
static javax.crypto.SecretKey |
PGPUtil.makeRandomKey(int algorithm,
java.security.SecureRandom random) |
java.io.OutputStream |
PGPEncryptedDataGenerator.open(java.io.OutputStream out,
byte[] buffer)
Return an outputstream which will encrypt the data as it is written
to it.
|
java.io.OutputStream |
PGPCompressedDataGenerator.open(java.io.OutputStream out,
byte[] buffer)
Return an outputstream which will compress the data as it is written
to it.
|
java.io.OutputStream |
PGPEncryptedDataGenerator.open(java.io.OutputStream out,
long length)
Return an outputstream which will encrypt the data as it is written
to it.
|
boolean |
PGPSignature.verify() |
boolean |
PGPEncryptedData.verify()
Note: This can only be called after the message has been read.
|
boolean |
PGPOnePassSignature.verify(PGPSignature pgpSig)
Verify the calculated signature against the passed in PGPSignature.
|
boolean |
PGPSignature.verifyCertification(PGPPublicKey pubKey)
Verify a key certification, such as a revocation, for the passed in key.
|
boolean |
PGPSignature.verifyCertification(PGPPublicKey masterKey,
PGPPublicKey pubKey)
Verify a certification for the passed in key against the passed in
master key.
|
boolean |
PGPSignature.verifyCertification(PGPUserAttributeSubpacketVector userAttributes,
PGPPublicKey key)
Verify the signature as certifying the passed in public key as associated
with the passed in user attributes.
|
boolean |
PGPSignature.verifyCertification(java.lang.String id,
PGPPublicKey key)
Verify the signature as certifying the passed in public key as associated
with the passed in id.
|
Constructor and Description |
---|
PGPKeyPair(int algorithm,
java.security.KeyPair keyPair,
java.util.Date time) |
PGPKeyPair(int algorithm,
java.security.KeyPair keyPair,
java.util.Date time,
java.lang.String provider)
Deprecated.
use version without provider.
|
PGPKeyPair(int algorithm,
java.security.PublicKey pubKey,
java.security.PrivateKey privKey,
java.util.Date time) |
PGPKeyPair(int algorithm,
java.security.PublicKey pubKey,
java.security.PrivateKey privKey,
java.util.Date time,
java.lang.String provider)
Deprecated.
use version without provider.
|
PGPKeyRingGenerator(int certificationLevel,
PGPKeyPair masterKey,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
boolean useSHA1,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.security.Provider provider)
Create a new key ring generator.
|
PGPKeyRingGenerator(int certificationLevel,
PGPKeyPair masterKey,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
boolean useSHA1,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.lang.String provider)
Create a new key ring generator.
|
PGPKeyRingGenerator(int certificationLevel,
PGPKeyPair masterKey,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.lang.String provider)
Create a new key ring generator using old style checksumming.
|
PGPPublicKey(int algorithm,
java.security.PublicKey pubKey,
java.util.Date time) |
PGPPublicKey(int algorithm,
java.security.PublicKey pubKey,
java.util.Date time,
java.lang.String provider)
Create a PGPPublicKey from the passed in JCA one.
|
PGPPublicKeyRingCollection(byte[] encoding) |
PGPPublicKeyRingCollection(java.util.Collection collection) |
PGPPublicKeyRingCollection(java.io.InputStream in)
Build a PGPPublicKeyRingCollection from the passed in input stream.
|
PGPSecretKey(int certificationLevel,
int algorithm,
java.security.PublicKey pubKey,
java.security.PrivateKey privKey,
java.util.Date time,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
boolean useSHA1,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.lang.String provider) |
PGPSecretKey(int certificationLevel,
int algorithm,
java.security.PublicKey pubKey,
java.security.PrivateKey privKey,
java.util.Date time,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.lang.String provider) |
PGPSecretKey(int certificationLevel,
PGPKeyPair keyPair,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
boolean useSHA1,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.security.Provider provider) |
PGPSecretKey(int certificationLevel,
PGPKeyPair keyPair,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
boolean useSHA1,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.lang.String provider) |
PGPSecretKey(int certificationLevel,
PGPKeyPair keyPair,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.lang.String provider) |
PGPSecretKeyRing(byte[] encoding) |
PGPSecretKeyRing(java.io.InputStream in) |
PGPSecretKeyRingCollection(byte[] encoding) |
PGPSecretKeyRingCollection(java.util.Collection collection) |
PGPSecretKeyRingCollection(java.io.InputStream in)
Build a PGPSecretKeyRingCollection from the passed in input stream.
|
PGPSignatureGenerator(int keyAlgorithm,
int hashAlgorithm,
java.security.Provider provider) |
PGPSignatureGenerator(int keyAlgorithm,
int hashAlgorithm,
java.lang.String provider)
Create a generator for the passed in keyAlgorithm and hashAlgorithm codes.
|
PGPSignatureGenerator(int keyAlgorithm,
java.security.Provider sigProvider,
int hashAlgorithm,
java.security.Provider digProvider) |
PGPSignatureGenerator(int keyAlgorithm,
java.lang.String sigProvider,
int hashAlgorithm,
java.lang.String digProvider)
Create a generator for the passed in keyAlgorithm and hashAlgorithm codes.
|
PGPV3SignatureGenerator(int keyAlgorithm,
int hashAlgorithm,
java.security.Provider provider) |
PGPV3SignatureGenerator(int keyAlgorithm,
int hashAlgorithm,
java.lang.String provider)
Create a generator for the passed in keyAlgorithm and hashAlgorithm codes.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
ByteArrayHandler.decrypt(byte[] encrypted,
char[] passPhrase)
decrypt the passed in message stream
|
static byte[] |
ByteArrayHandler.encrypt(byte[] clearData,
char[] passPhrase,
java.lang.String fileName,
int algorithm,
boolean armor)
Simple PGP encryptor between byte[].
|