aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces')
-rw-r--r--libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHKey.java20
-rw-r--r--libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHPrivateKey.java21
-rw-r--r--libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHPublicKey.java21
-rw-r--r--libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/PBEKey.java41
4 files changed, 103 insertions, 0 deletions
diff --git a/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHKey.java b/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHKey.java
new file mode 100644
index 000000000..5d404110f
--- /dev/null
+++ b/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHKey.java
@@ -0,0 +1,20 @@
+package javax.crypto.interfaces;
+
+import javax.crypto.spec.DHParameterSpec;
+
+/**
+ * The interface to a Diffie-Hellman key.
+ *
+ * @see DHParameterSpec
+ * @see DHPublicKey
+ * @see DHPrivateKey
+ */
+public abstract interface DHKey
+{
+ /**
+ * Returns the key parameters.
+ *
+ * @return the key parameters
+ */
+ public DHParameterSpec getParams();
+}
diff --git a/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHPrivateKey.java b/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHPrivateKey.java
new file mode 100644
index 000000000..3fc7de99b
--- /dev/null
+++ b/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHPrivateKey.java
@@ -0,0 +1,21 @@
+package javax.crypto.interfaces;
+
+import java.math.BigInteger;
+import java.security.PrivateKey;
+
+/**
+ * The interface to a Diffie-Hellman private key.
+ *
+ * @see DHKey
+ * @see DHPublicKey
+ */
+public abstract interface DHPrivateKey
+ extends DHKey, PrivateKey
+{
+ /**
+ * Returns the private value, <code>x</code>.
+ *
+ * @return the private value, <code>x</code>
+ */
+ public BigInteger getX();
+}
diff --git a/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHPublicKey.java b/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHPublicKey.java
new file mode 100644
index 000000000..3d395afa4
--- /dev/null
+++ b/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/DHPublicKey.java
@@ -0,0 +1,21 @@
+package javax.crypto.interfaces;
+
+import java.math.BigInteger;
+import java.security.PublicKey;
+
+/**
+ * The interface to a Diffie-Hellman public key.
+ *
+ * @see DHKey
+ * @see DHPrivateKey
+ */
+public abstract interface DHPublicKey
+ extends DHKey, PublicKey
+{
+ /**
+ * Returns the public value, <code>y</code>.
+ *
+ * @return the public value, <code>y</code>
+ */
+ public BigInteger getY();
+}
diff --git a/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/PBEKey.java b/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/PBEKey.java
new file mode 100644
index 000000000..8d9ab1f67
--- /dev/null
+++ b/libraries/spongycastle/jce/src/main/java/javax/crypto/interfaces/PBEKey.java
@@ -0,0 +1,41 @@
+package javax.crypto.interfaces;
+
+import javax.crypto.SecretKey;
+
+/**
+ * The interface to a PBE key.
+ *
+ * @see PBEKeySpec, SecretKey
+ */
+public interface PBEKey
+ extends SecretKey
+{
+ /**
+ * Returns the password.
+ *
+ * Note: this method should return a copy of the password. It is the
+ * caller's responsibility to zero out the password information after it is
+ * no longer needed.
+ *
+ * @return the password.
+ */
+ public char[] getPassword();
+
+ /**
+ * Returns the salt or null if not specified.
+ *
+ * Note: this method should return a copy of the salt. It is the caller's
+ * responsibility to zero out the salt information after it is no longer
+ * needed.
+ *
+ * @return the salt.
+ */
+ public byte[] getSalt();
+
+ /**
+ * Returns the iteration count or 0 if not specified.
+ *
+ * @return the iteration count.
+ */
+ public int getIterationCount();
+}