Bouncy Castle Cryptography 1.21

org.bouncycastle.openpgp
Class PGPEncryptedDataGenerator

java.lang.Object
  |
  +--org.bouncycastle.openpgp.PGPEncryptedDataGenerator
All Implemented Interfaces:
HashAlgorithmTags, PacketTags, PublicKeyAlgorithmTags, SymmetricKeyAlgorithmTags

public class PGPEncryptedDataGenerator
extends java.lang.Object
implements PacketTags, PublicKeyAlgorithmTags, SymmetricKeyAlgorithmTags, HashAlgorithmTags

Generator for encrypted objects.


Field Summary
 
Fields inherited from interface org.bouncycastle.bcpg.PacketTags
COMPRESSED_DATA, EXPIRIMENTAL_1, EXPIRIMENTAL_2, EXPIRIMENTAL_3, EXPIRIMENTAL_4, LITERAL_DATA, MARKER, MOD_DETECTION_CODE, ONE_PASS_SIGNATURE, PUBLIC_KEY, PUBLIC_KEY_ENC_SESSION, PUBLIC_SUBKEY, RESERVED, SECRET_KEY, SECRET_SUBKEY, SIGNATURE, SYM_ENC_INTEGRITY_PRO, SYMMETRIC_KEY_ENC, SYMMETRIC_KEY_ENC_SESSION, TRUST, USER_ATTRIBUTE, USER_ID
 
Fields inherited from interface org.bouncycastle.bcpg.PublicKeyAlgorithmTags
DIFFIE_HELLMAN, DSA, EC, ECDSA, ELGAMAL_ENCRYPT, ELGAMAL_GENERAL, RSA_ENCRYPT, RSA_GENERAL, RSA_SIGN
 
Fields inherited from interface org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags
AES_128, AES_192, AES_256, BLOWFISH, CAST5, DES, IDEA, NULL, SAFER, TRIPLE_DES, TWOFISH
 
Fields inherited from interface org.bouncycastle.bcpg.HashAlgorithmTags
DOUBLE_SHA, HAVAL_5_160, MD2, MD5, RIPEMD160, SHA1, TIGER_192
 
Constructor Summary
PGPEncryptedDataGenerator(int encAlgorithm, java.security.SecureRandom rand, java.lang.String provider)
           
 
Method Summary
 void addMethod(char[] passPhrase)
          Add a PBE encryption method to the encrypted object.
 void addMethod(PGPPublicKey key)
          Add a public key encrypted session key to the encrypted object.
 void close()
          Close off the encrypted object.
 java.io.OutputStream open(java.io.OutputStream out, long length)
          Return an outputstream which will encrypt the data as it is written to it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPEncryptedDataGenerator

public PGPEncryptedDataGenerator(int encAlgorithm,
                                 java.security.SecureRandom rand,
                                 java.lang.String provider)
Method Detail

addMethod

public void addMethod(char[] passPhrase)
               throws java.security.NoSuchProviderException,
                      PGPException
Add a PBE encryption method to the encrypted object.

Parameters:
passPhrase -
Throws:
java.security.NoSuchProviderException
PGPException

addMethod

public void addMethod(PGPPublicKey key)
               throws java.security.NoSuchProviderException,
                      PGPException
Add a public key encrypted session key to the encrypted object.

Parameters:
key -
Throws:
java.security.NoSuchProviderException
PGPException

open

public java.io.OutputStream open(java.io.OutputStream out,
                                 long length)
                          throws java.io.IOException,
                                 PGPException
Return an outputstream which will encrypt the data as it is written to it.

Parameters:
out -
length -
Returns:
OutputStream
Throws:
java.io.IOException
PGPException

close

public void close()
           throws java.io.IOException
Close off the encrypted object.

Throws:
java.io.IOException

Bouncy Castle Cryptography 1.21