Move prekey jsonifcation into the push code, add identity key.

This commit is contained in:
Moxie Marlinspike
2013-08-17 19:06:04 -07:00
parent b8f663b69c
commit 499de2d2bf
11 changed files with 134 additions and 65 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.util.Log;
import org.whispersystems.textsecure.crypto.InvalidKeyException;
import org.whispersystems.textsecure.crypto.KeyUtil;
import org.whispersystems.textsecure.crypto.MasterSecret;
import org.whispersystems.textsecure.crypto.PreKeyPair;
@@ -51,6 +52,10 @@ public class PreKeyRecord extends Record {
return keyPair;
}
public byte[] getEncodedPublicKey() {
return KeyUtil.encodePoint(keyPair.getPublicKey().getQ());
}
public static boolean hasRecord(Context context, long id) {
Log.w("PreKeyRecord", "Checking: " + id);
return Record.hasRecord(context, PREKEY_DIRECTORY, id+"");