LastDeviceRecoveryKeyStatus

The server's state of a user's offline last-device recovery key (docs/recovery-key-lifecycle.md), as returned to a registered device of the user by the signed GET /v1/devices/{user}/{device}/last-device-recovery/key.

The recovery key epoch is 1 after the first registration and grows by one with every rotation, revocation and registration after a revocation. It never decreases and is independent of any device authentication epoch.

Inheritors

Types

Link copied to clipboard
class Active(val epoch: Long, val installedAt: Instant, publicKey: ByteArray) : LastDeviceRecoveryKeyStatus

A recovery key is registered: publicKey (32 bytes, public data), at epoch, installed at the server time installedAt (registration or the rotation that installed it; retries change neither).

Link copied to clipboard
data class Revoked(val epoch: Long, val revokedAt: Instant) : LastDeviceRecoveryKeyStatus

The recovery key was revoked at the server time revokedAt; no key is registered and no last-device recovery is possible until a new key is registered (at a higher epoch).

Link copied to clipboard

The user never registered a recovery key.