Package org.signal.libsignal.svr2
Class PinHash
-
- All Implemented Interfaces:
-
org.signal.libsignal.internal.NativeHandleGuard.Owner
public class PinHash extends NativeHandleGuard.SimpleOwner
A hash of the pin that can be used to interact with a Secure Value Recovery service.
-
-
Method Summary
Modifier and Type Method Description static PinHashsvr1(Array<byte> normalizedPin, Array<byte> salt)Hash a pin for use with a remote SecureValueRecovery1 service. static PinHashsvr2(Array<byte> normalizedPin, String username, Array<byte> mrenclave)Hash a pin for use with a remote SecureValueRecovery2 service. Array<byte>encryptionKey()A key that can be used to encrypt or decrypt values before uploading them to a secure store. Array<byte>accessKey()A secret that can be used to access a value in a secure store. -
Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.SimpleOwner
unsafeNativeHandleWithoutGuard -
Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.Owner
guard, guardedMap, guardedMapChecked, guardedRun, guardedRunChecked -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
svr1
static PinHash svr1(Array<byte> normalizedPin, Array<byte> salt)
Hash a pin for use with a remote SecureValueRecovery1 service.
Note: This should be used with SVR1 only. For SVR1, the salt should be the backup id. For SVR2 clients, use svr2 which handles salt selection internally.
- Parameters:
normalizedPin- A normalized, UTF-8 encoded byte representation of the pinsalt- A 32 byte salt- Returns:
A PinHash
-
svr2
static PinHash svr2(Array<byte> normalizedPin, String username, Array<byte> mrenclave)
Hash a pin for use with a remote SecureValueRecovery2 service.
Note: This should be used with SVR2 only. For SVR1 clients, use svr1
- Parameters:
normalizedPin- A normalized, UTF-8 encoded byte representation of the pinusername- The Basic Auth username used to authenticate with SVR2mrenclave- The mrenclave where the hashed pin will be stored- Returns:
A PinHash
-
encryptionKey
Array<byte> encryptionKey()
A key that can be used to encrypt or decrypt values before uploading them to a secure store.
- Returns:
a 32 byte encryption key
-
-
-
-