RecoveryKeyReset

Delayed recovery key reset, format version 1 (docs/recovery-key-reset.md). Integers are big-endian, strings u32 length | UTF-8.

Completion statement:

u32 length | userId
reset ID (16)
expected recovery key epoch: i64 (>= 1)
current recovery public key (32)
new recovery public key (32) // ≠ current
requestedAt: i64, epoch milliseconds (>= 0)
eligibleAt: i64, epoch milliseconds (> requestedAt)
u32 length | completer userId // = userId
u32 length | completer deviceId

Cancellation statement:

u32 length | userId
reset ID (16)
expected recovery key epoch: i64
current recovery public key (32)
requestedAt: i64 | eligibleAt: i64

Status query statement:

u32 length | userId
current recovery public key (32)
timestamp: i64, epoch milliseconds

Each construction prefixes u32 length | domain (UTF-8):

  • completion proof of possession, Ed25519 by the new recovery key: KSecureMessage-RecoveryKeyReset-NewKeyPoP-v1;

  • RecoveryKeyResetCompletionId, SHA-256: KSecureMessage-RecoveryKeyResetId-v1;

  • cancellation, Ed25519 by the current recovery key: KSecureMessage-RecoveryKeyReset-Cancel-v1;

  • status query, Ed25519 by the current recovery key: KSecureMessage-RecoveryKeyResetStatusQuery-v1.

No domain is shared with any other construction.

Properties

Link copied to clipboard
const val PUBLIC_KEY_SIZE: Int

Size of a recovery public key (Ed25519).

Link copied to clipboard
const val SIGNATURE_SIZE: Int

Size of a signature (Ed25519).

Link copied to clipboard

Accepted clock difference of a status query in each direction: now - VALIDITY_WINDOW <= timestamp <= now + VALIDITY_WINDOW.

Functions

Link copied to clipboard

The cancellation of reset by the recovery key it would replace, currentKey. Throws IllegalArgumentException if currentKey is not the key reset replaces.

Link copied to clipboard

The bytes the current recovery key signs to cancel.

Link copied to clipboard

The completion of reset with newKey by completer, signed by newKey. The application must have backed up newKey before it sends this. Throws IllegalArgumentException if newKey is the key being replaced or completer belongs to another user.

Link copied to clipboard

The bytes the new recovery key signs.

Link copied to clipboard

A status query for userId's pending reset, signed by currentKey. timestamp is truncated to milliseconds.

Link copied to clipboard

The bytes the current recovery key signs to query the status.

Link copied to clipboard

true if the cancellation verifies with currentPublicKey; the server passes the registered recovery key.

Link copied to clipboard

true if the proof of possession verifies with the statement's new key.

Link copied to clipboard

true if the status query verifies with currentPublicKey; the server passes the registered recovery key.