diff options
author | Moxie Marlinspike <moxie@thoughtcrime.org> | 2015-01-08 13:48:49 -0800 |
---|---|---|
committer | Moxie Marlinspike <moxie@thoughtcrime.org> | 2015-01-08 14:09:01 -0800 |
commit | 6445ea5f13850f42c3952bd06a2369317683ed88 (patch) | |
tree | f2bb37c8cf4710ff6a6a37a3e7e702c5a21ca504 /src/main/java/org/whispersystems/libaxolotl/ratchet/AliceAxolotlParameters.java | |
parent | a4d8f7f6a4c4e9e89db35f299e558dceee2362a1 (diff) |
Break project up into Java and Android build/test.
Diffstat (limited to 'src/main/java/org/whispersystems/libaxolotl/ratchet/AliceAxolotlParameters.java')
-rw-r--r-- | src/main/java/org/whispersystems/libaxolotl/ratchet/AliceAxolotlParameters.java | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/src/main/java/org/whispersystems/libaxolotl/ratchet/AliceAxolotlParameters.java b/src/main/java/org/whispersystems/libaxolotl/ratchet/AliceAxolotlParameters.java deleted file mode 100644 index 13c995e9..00000000 --- a/src/main/java/org/whispersystems/libaxolotl/ratchet/AliceAxolotlParameters.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.whispersystems.libaxolotl.ratchet; - -import org.whispersystems.libaxolotl.IdentityKey; -import org.whispersystems.libaxolotl.IdentityKeyPair; -import org.whispersystems.libaxolotl.ecc.ECKeyPair; -import org.whispersystems.libaxolotl.ecc.ECPublicKey; -import org.whispersystems.libaxolotl.util.guava.Optional; - -public class AliceAxolotlParameters { - - private final IdentityKeyPair ourIdentityKey; - private final ECKeyPair ourBaseKey; - - private final IdentityKey theirIdentityKey; - private final ECPublicKey theirSignedPreKey; - private final Optional<ECPublicKey> theirOneTimePreKey; - private final ECPublicKey theirRatchetKey; - - private AliceAxolotlParameters(IdentityKeyPair ourIdentityKey, ECKeyPair ourBaseKey, - IdentityKey theirIdentityKey, ECPublicKey theirSignedPreKey, - ECPublicKey theirRatchetKey, Optional<ECPublicKey> theirOneTimePreKey) - { - this.ourIdentityKey = ourIdentityKey; - this.ourBaseKey = ourBaseKey; - this.theirIdentityKey = theirIdentityKey; - this.theirSignedPreKey = theirSignedPreKey; - this.theirRatchetKey = theirRatchetKey; - this.theirOneTimePreKey = theirOneTimePreKey; - - if (ourIdentityKey == null || ourBaseKey == null || theirIdentityKey == null || - theirSignedPreKey == null || theirRatchetKey == null || theirOneTimePreKey == null) - { - throw new IllegalArgumentException("Null values!"); - } - } - - public IdentityKeyPair getOurIdentityKey() { - return ourIdentityKey; - } - - public ECKeyPair getOurBaseKey() { - return ourBaseKey; - } - - public IdentityKey getTheirIdentityKey() { - return theirIdentityKey; - } - - public ECPublicKey getTheirSignedPreKey() { - return theirSignedPreKey; - } - - public Optional<ECPublicKey> getTheirOneTimePreKey() { - return theirOneTimePreKey; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public ECPublicKey getTheirRatchetKey() { - return theirRatchetKey; - } - - public static class Builder { - private IdentityKeyPair ourIdentityKey; - private ECKeyPair ourBaseKey; - - private IdentityKey theirIdentityKey; - private ECPublicKey theirSignedPreKey; - private ECPublicKey theirRatchetKey; - private Optional<ECPublicKey> theirOneTimePreKey; - - public Builder setOurIdentityKey(IdentityKeyPair ourIdentityKey) { - this.ourIdentityKey = ourIdentityKey; - return this; - } - - public Builder setOurBaseKey(ECKeyPair ourBaseKey) { - this.ourBaseKey = ourBaseKey; - return this; - } - - public Builder setTheirRatchetKey(ECPublicKey theirRatchetKey) { - this.theirRatchetKey = theirRatchetKey; - return this; - } - - public Builder setTheirIdentityKey(IdentityKey theirIdentityKey) { - this.theirIdentityKey = theirIdentityKey; - return this; - } - - public Builder setTheirSignedPreKey(ECPublicKey theirSignedPreKey) { - this.theirSignedPreKey = theirSignedPreKey; - return this; - } - - public Builder setTheirOneTimePreKey(Optional<ECPublicKey> theirOneTimePreKey) { - this.theirOneTimePreKey = theirOneTimePreKey; - return this; - } - - public AliceAxolotlParameters create() { - return new AliceAxolotlParameters(ourIdentityKey, ourBaseKey, theirIdentityKey, - theirSignedPreKey, theirRatchetKey, theirOneTimePreKey); - } - } -} |