Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/org/spongycastle/crypto/KeyEncapsulation.java')
-rwxr-xr-xcore/src/main/java/org/spongycastle/crypto/KeyEncapsulation.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/src/main/java/org/spongycastle/crypto/KeyEncapsulation.java b/core/src/main/java/org/spongycastle/crypto/KeyEncapsulation.java
new file mode 100755
index 00000000..1a53e790
--- /dev/null
+++ b/core/src/main/java/org/spongycastle/crypto/KeyEncapsulation.java
@@ -0,0 +1,22 @@
+package org.spongycastle.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);
+}