Encode prekey as full JSON rather than protobuf blobs.

1) Split prekey messages out into full JSON.

2) Add support for retrieving prekeys.
This commit is contained in:
Moxie Marlinspike
2013-08-18 14:35:23 -07:00
parent 499de2d2bf
commit edb89ee3e9
9 changed files with 181 additions and 541 deletions

View File

@@ -4,7 +4,6 @@ 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;
@@ -52,10 +51,6 @@ 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+"");