public class SymmetricEncryptorDecryptor extends Object
Constructor and Description |
---|
SymmetricEncryptorDecryptor() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
symmetricallyDecrypt(byte[] data,
Passphrase password)
Decrypt and decompress some symmetrically encrypted data using a password.
|
static byte[] |
symmetricallyEncrypt(byte[] data,
Passphrase password,
SymmetricKeyAlgorithm encryptionAlgorithm,
CompressionAlgorithm compressionAlgorithm)
Encrypt some
data symmetrically using an encryptionAlgorithm and a given password . |
public SymmetricEncryptorDecryptor()
public static byte[] symmetricallyEncrypt(@Nonnull byte[] data, @Nonnull Passphrase password, @Nonnull SymmetricKeyAlgorithm encryptionAlgorithm, @Nonnull CompressionAlgorithm compressionAlgorithm) throws IOException, org.bouncycastle.openpgp.PGPException
data
symmetrically using an encryptionAlgorithm
and a given password
.
The input data will be compressed using the given compressionAlgorithm
and packed in a modification
detection package, which is then encrypted.data
- bytes that will be encryptedpassword
- password that will be used to encrypt the dataencryptionAlgorithm
- symmetric algorithm that will be used to encrypt the datacompressionAlgorithm
- compression algorithm that will be used to compress the dataIOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- OpenPGP is brittlepublic static byte[] symmetricallyDecrypt(@Nonnull byte[] data, @Nonnull Passphrase password) throws IOException, org.bouncycastle.openpgp.PGPException
data
- encrypted datapassword
- password to decrypt the dataIOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- OpenPGP is brittle