Update libsignal-service-java

- Use new ProfileKey class instead of byte array
- Add capabilities (for future support of uuid and groups v2)
This commit is contained in:
AsamK 2020-03-21 14:37:02 +01:00
parent 31434ac5ec
commit 0dc6b1327e
5 changed files with 57 additions and 23 deletions

View file

@ -1,6 +1,8 @@
package org.asamk.signal.manager;
import org.asamk.signal.util.RandomUtils;
import org.signal.zkgroup.InvalidInputException;
import org.signal.zkgroup.profiles.ProfileKey;
import org.whispersystems.util.Base64;
class KeyUtils {
@ -12,8 +14,12 @@ class KeyUtils {
return getSecret(52);
}
static byte[] createProfileKey() {
return getSecretBytes(32);
static ProfileKey createProfileKey() {
try {
return new ProfileKey(getSecretBytes(32));
} catch (InvalidInputException e) {
throw new AssertionError("Profile key is guaranteed to be 32 bytes here");
}
}
static String createPassword() {