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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static PinHash svr1(Array<byte> normalizedPin, Array<byte> salt) Hash a pin for use with a remote SecureValueRecovery1 service.
      static PinHash svr2(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
    • Constructor Detail

    • 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 pin
        salt - 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 pin
        username - The Basic Auth username used to authenticate with SVR2
        mrenclave - 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

      • accessKey

         Array<byte> accessKey()

        A secret that can be used to access a value in a secure store.

        Returns:

        a 32 byte access key