mirror of
https://github.com/signalapp/libsignal.git
synced 2026-05-11 01:22:08 +02:00
Fixes for Android
- Allow info to be null/empty in HKDF arguments. This is used during KBS attestation. - Allow creating an ECPublicKey from the un-typed key bytes, also used when talking to KBS.
This commit is contained in:
@@ -24,6 +24,13 @@ public class ECPublicKey implements Comparable<ECPublicKey> {
|
||||
this.handle = Native.ECPublicKey_Deserialize(serialized, 0);
|
||||
}
|
||||
|
||||
static public ECPublicKey fromPublicKey(byte[] key) {
|
||||
byte[] with_type = new byte[33];
|
||||
with_type[0] = 0x05;
|
||||
System.arraycopy(key, 0, with_type, 1, 32);
|
||||
return new ECPublicKey(Native.ECPublicKey_Deserialize(with_type, 0));
|
||||
}
|
||||
|
||||
public ECPublicKey(long nativeHandle) {
|
||||
if (nativeHandle == 0) {
|
||||
throw new NullPointerException();
|
||||
|
||||
Reference in New Issue
Block a user