org.bouncycastle.openpgp
public class PGPEncryptedDataGenerator extends Object implements SymmetricKeyAlgorithmTags, StreamGenerator
Constructor Summary | |
---|---|
PGPEncryptedDataGenerator(int encAlgorithm, SecureRandom rand, String provider)
Base constructor.
| |
PGPEncryptedDataGenerator(int encAlgorithm, boolean withIntegrityPacket, SecureRandom rand, String provider)
Creates a cipher stream which will have an integrity packet
associated with it.
| |
PGPEncryptedDataGenerator(int encAlgorithm, SecureRandom rand, boolean oldFormat, String provider)
Base constructor.
|
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 - this is equivalent to calling close on the stream
returned by the open() method.
|
OutputStream | open(OutputStream out, long length)
Return an outputstream which will encrypt the data as it is written
to it. |
OutputStream | open(OutputStream out, byte[] buffer)
Return an outputstream which will encrypt the data as it is written
to it. |
Parameters: encAlgorithm the symmetric algorithm to use. rand source of randomness provider the provider to use for encryption algorithms.
Parameters: encAlgorithm withIntegrityPacket rand provider
Parameters: encAlgorithm the symmetric algorithm to use. rand source of randomness oldFormat PGP 2.6.x compatability required. provider the provider to use for encryption algorithms.
Parameters: passPhrase
Throws: NoSuchProviderException PGPException
Parameters: key
Throws: NoSuchProviderException PGPException
Throws: IOException
Parameters: out length
Returns: OutputStream
Throws: IOException PGPException
Note: if the buffer is not a power of 2 in length only the largest power of 2 bytes worth of the buffer will be used.
Parameters: out buffer the buffer to use.
Returns: OutputStream
Throws: IOException PGPException