Files
Android/library/src/org/whispersystems/textsecure/crypto/PreKeyPublic.java
2014-01-06 14:35:51 -08:00

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;
}
}