aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/java/org/whispersystems/libaxolotl/TestInMemoryAxolotlStore.java
diff options
context:
space:
mode:
authorMoxie Marlinspike <moxie@thoughtcrime.org>2015-03-04 18:49:20 -0800
committerMoxie Marlinspike <moxie@thoughtcrime.org>2015-03-04 18:49:20 -0800
commit7262e6970b86fe0a23ee48afca7bba37bcad1cdf (patch)
treee216b2b2895647bf02a1e39b365c8daa6a44ae37 /tests/src/test/java/org/whispersystems/libaxolotl/TestInMemoryAxolotlStore.java
parentaf48198d9c683bed0545eb9bf8469a6dccf2cdd3 (diff)
Move in memory data structures into project.
Diffstat (limited to 'tests/src/test/java/org/whispersystems/libaxolotl/TestInMemoryAxolotlStore.java')
-rw-r--r--tests/src/test/java/org/whispersystems/libaxolotl/TestInMemoryAxolotlStore.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/src/test/java/org/whispersystems/libaxolotl/TestInMemoryAxolotlStore.java b/tests/src/test/java/org/whispersystems/libaxolotl/TestInMemoryAxolotlStore.java
new file mode 100644
index 00000000..8c4700fc
--- /dev/null
+++ b/tests/src/test/java/org/whispersystems/libaxolotl/TestInMemoryAxolotlStore.java
@@ -0,0 +1,22 @@
+package org.whispersystems.libaxolotl;
+
+import org.whispersystems.libaxolotl.ecc.Curve;
+import org.whispersystems.libaxolotl.ecc.ECKeyPair;
+import org.whispersystems.libaxolotl.util.KeyHelper;
+
+public class TestInMemoryAxolotlStore extends org.whispersystems.libaxolotl.state.impl.InMemoryAxolotlStore {
+ public TestInMemoryAxolotlStore() {
+ super(generateIdentityKeyPair(), generateRegistrationId());
+ }
+
+ private static IdentityKeyPair generateIdentityKeyPair() {
+ ECKeyPair identityKeyPairKeys = Curve.generateKeyPair();
+
+ return new IdentityKeyPair(new IdentityKey(identityKeyPairKeys.getPublicKey()),
+ identityKeyPairKeys.getPrivateKey());
+ }
+
+ private static int generateRegistrationId() {
+ return KeyHelper.generateRegistrationId(false);
+ }
+}