X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/425626ef9475cbc90ef8ada95dee172389baf521..e74be0c345321888c1fbfa05616cb90cf3f07ffb:/src/main/java/org/asamk/signal/manager/util/KeyUtils.java diff --git a/src/main/java/org/asamk/signal/manager/util/KeyUtils.java b/src/main/java/org/asamk/signal/manager/util/KeyUtils.java index 3f9ec08f..d8861b1b 100644 --- a/src/main/java/org/asamk/signal/manager/util/KeyUtils.java +++ b/src/main/java/org/asamk/signal/manager/util/KeyUtils.java @@ -3,6 +3,11 @@ package org.asamk.signal.manager.util; import org.asamk.signal.util.RandomUtils; import org.signal.zkgroup.InvalidInputException; import org.signal.zkgroup.profiles.ProfileKey; +import org.whispersystems.libsignal.IdentityKey; +import org.whispersystems.libsignal.IdentityKeyPair; +import org.whispersystems.libsignal.ecc.Curve; +import org.whispersystems.libsignal.ecc.ECKeyPair; +import org.whispersystems.libsignal.ecc.ECPrivateKey; import org.whispersystems.signalservice.api.kbs.MasterKey; import org.whispersystems.util.Base64; @@ -11,6 +16,14 @@ public class KeyUtils { private KeyUtils() { } + public static IdentityKeyPair generateIdentityKeyPair() { + ECKeyPair djbKeyPair = Curve.generateKeyPair(); + IdentityKey djbIdentityKey = new IdentityKey(djbKeyPair.getPublicKey()); + ECPrivateKey djbPrivateKey = djbKeyPair.getPrivateKey(); + + return new IdentityKeyPair(djbIdentityKey, djbPrivateKey); + } + public static String createSignalingKey() { return getSecret(52); }