mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-29 13:16:01 +01:00
26 lines
593 B
Java
26 lines
593 B
Java
package org.whispersystems.textsecure.crypto;
|
|
|
|
import org.spongycastle.crypto.params.ECPublicKeyParameters;
|
|
|
|
public class PreKeyPublic {
|
|
|
|
private final ECPublicKeyParameters publicKey;
|
|
|
|
public PreKeyPublic(ECPublicKeyParameters publicKey) {
|
|
this.publicKey = publicKey;
|
|
}
|
|
|
|
public PreKeyPublic(byte[] serialized, int offset) throws InvalidKeyException {
|
|
this.publicKey = KeyUtil.decodePoint(serialized, offset);
|
|
}
|
|
|
|
public byte[] serialize() {
|
|
return KeyUtil.encodePoint(publicKey.getQ());
|
|
}
|
|
|
|
public ECPublicKeyParameters getPublicKey() {
|
|
return publicKey;
|
|
}
|
|
|
|
}
|