Interface PGPDataEncryptor
- All Known Subinterfaces:
PGPAEADDataEncryptor
public interface PGPDataEncryptor
A data encryptor, combining a cipher instance and an optional integrity check calculator.
PGPDataEncryptor
instances are generally not constructed directly, but obtained from a
PGPDataEncryptorBuilder
.
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the block size of the underlying cipher used by this encryptor.Obtains the integrity check calculator configured for this encryptor instance.Constructs an encrypting output stream that encrypts data using the underlying cipher of this encryptor.
-
Method Details
-
getOutputStream
Constructs an encrypting output stream that encrypts data using the underlying cipher of this encryptor.The cipher instance in this encryptor is used for all output streams obtained from this method, so it should only be invoked once.
- Parameters:
out
- the stream to wrap and write encrypted data to.- Returns:
- a cipher output stream appropriate to the type of this data encryptor.
-
getIntegrityCalculator
PGPDigestCalculator getIntegrityCalculator()Obtains the integrity check calculator configured for this encryptor instance.- Returns:
- the integrity check calculator, or
null
if no integrity checking was configured.
-
getBlockSize
int getBlockSize()Gets the block size of the underlying cipher used by this encryptor.- Returns:
- the block size in bytes.
-