aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/params/ParametersWithRandom.java
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/params/ParametersWithRandom.java')
-rw-r--r--libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/params/ParametersWithRandom.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/params/ParametersWithRandom.java b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/params/ParametersWithRandom.java
new file mode 100644
index 000000000..ca445554e
--- /dev/null
+++ b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/params/ParametersWithRandom.java
@@ -0,0 +1,36 @@
+package org.spongycastle.crypto.params;
+
+import org.spongycastle.crypto.CipherParameters;
+
+import java.security.SecureRandom;
+
+public class ParametersWithRandom
+ implements CipherParameters
+{
+ private SecureRandom random;
+ private CipherParameters parameters;
+
+ public ParametersWithRandom(
+ CipherParameters parameters,
+ SecureRandom random)
+ {
+ this.random = random;
+ this.parameters = parameters;
+ }
+
+ public ParametersWithRandom(
+ CipherParameters parameters)
+ {
+ this(parameters, new SecureRandom());
+ }
+
+ public SecureRandom getRandom()
+ {
+ return random;
+ }
+
+ public CipherParameters getParameters()
+ {
+ return parameters;
+ }
+}