diff options
Diffstat (limited to 'pg/src/main/java/org/spongycastle/openpgp/operator/PGPDataDecryptorFactory.java')
-rw-r--r-- | pg/src/main/java/org/spongycastle/openpgp/operator/PGPDataDecryptorFactory.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pg/src/main/java/org/spongycastle/openpgp/operator/PGPDataDecryptorFactory.java b/pg/src/main/java/org/spongycastle/openpgp/operator/PGPDataDecryptorFactory.java new file mode 100644 index 00000000..7223d039 --- /dev/null +++ b/pg/src/main/java/org/spongycastle/openpgp/operator/PGPDataDecryptorFactory.java @@ -0,0 +1,25 @@ +package org.spongycastle.openpgp.operator; + +import org.spongycastle.bcpg.SymmetricKeyAlgorithmTags; +import org.spongycastle.openpgp.PGPException; + +/** + * Base interface of factories for {@link PGPDataDecryptor}. + */ +public interface PGPDataDecryptorFactory +{ + /** + * Constructs a data decryptor. + * + * @param withIntegrityPacket <code>true</code> if the packet to be decrypted has integrity + * checking enabled. + * @param encAlgorithm the identifier of the {@link SymmetricKeyAlgorithmTags encryption + * algorithm} to decrypt with. + * @param key the bytes of the key for the cipher. + * @return a data decryptor that can decrypt (and verify) streams of encrypted data. + * @throws PGPException if an error occurs initialising the decryption and integrity checking + * functions. + */ + public PGPDataDecryptor createDataDecryptor(boolean withIntegrityPacket, int encAlgorithm, byte[] key) + throws PGPException; +} |