mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 12:32:17 +00:00
Add "last resort" PreKey generation to KeyHelper.
This commit is contained in:
@@ -74,4 +74,15 @@ public class KeyHelper {
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the last resort PreKey. Clients should do this only once, at install
|
||||
* time, and durably store it for the length of the install.
|
||||
*
|
||||
* @return the generated last resort PreKeyRecord.
|
||||
*/
|
||||
public static PreKeyRecord generateLastResortPreKey() {
|
||||
ECKeyPair keyPair = Curve.generateKeyPair(true);
|
||||
return new PreKeyRecord(Medium.MAX_VALUE, keyPair);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user