diff options
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/crypto/KeyEncapsulation.java')
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/crypto/KeyEncapsulation.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/KeyEncapsulation.java b/bcprov/src/main/java/org/bouncycastle/crypto/KeyEncapsulation.java new file mode 100644 index 0000000..1674457 --- /dev/null +++ b/bcprov/src/main/java/org/bouncycastle/crypto/KeyEncapsulation.java @@ -0,0 +1,22 @@ +package org.bouncycastle.crypto; + +/** + * The basic interface for key encapsulation mechanisms. + */ +public interface KeyEncapsulation +{ + /** + * Initialise the key encapsulation mechanism. + */ + public void init(CipherParameters param); + + /** + * Encapsulate a randomly generated session key. + */ + public CipherParameters encrypt(byte[] out, int outOff, int keyLen); + + /** + * Decapsulate an encapsulated session key. + */ + public CipherParameters decrypt(byte[] in, int inOff, int inLen, int keyLen); +} |