DeviceAuthenticationKeyStore
The local device's authentication key pair (docs/server-authentication.md), separate from the messaging identity. There is at most one active key. It is replaced only by promoting a pending key after the server accepted it: the pending recovery key of a device recovery (docs/device-recovery.md), the pending rotation key of a routine rotation (docs/device-authentication-rotation.md) or the pending last-device recovery key of a last-device recovery (docs/last-device-recovery.md). The three pending slots are separate, and at most one of them is filled at a time.
Functions
true only for storage that held a local identity before device authentication keys existed (milestone 12) and has not stored a key since. Such an installation gets its first key from SecureMessageClient.initialize. For any other storage a missing key means it was lost, and a new one must not be created. Storing a key makes this false for good.
The replacement key pair of a last-device recovery in progress (docs/last-device-recovery.md), or null. Never used to sign ordinary requests.
The replacement key pair of a device recovery in progress (docs/device-recovery.md), or null. Never used to sign ordinary requests.
The replacement key pair of a routine rotation in progress (docs/device-authentication-rotation.md), or null. Never used to sign ordinary requests.
In one atomic step: makes the pending last-device recovery key pair the active key (replacing the active key, or installing it if the active key was lost), removes the pending key and makes awaitsUpgradeKey false. Only for a pending key the server accepted. Throws IllegalStateException and changes nothing if there is no pending key.
In one atomic step: makes the pending recovery key pair the active key (replacing the active key, or installing it if the active key was lost), removes the pending key and makes awaitsUpgradeKey false. Only for a pending key the server accepted. Throws IllegalStateException and changes nothing if there is no pending key.
In one atomic step: makes the pending rotation key pair the active key (replacing the active key, or installing it if the active key was lost), removes the pending key and makes awaitsUpgradeKey false. Only for a pending key the server accepted. Throws IllegalStateException and changes nothing if there is no pending key.
Removes the pending last-device recovery key pair, if any. The active key and the other slots are not touched.
Removes the pending recovery key pair, if any. The active key is not touched.
Removes the pending rotation key pair, if any. The active key and a pending recovery key are not touched.
Stores the key pair. Throws IllegalStateException if one exists already, also an identical one: a key is never replaced silently.
Stores the replacement key pair of a last-device recovery. Throws IllegalStateException if one exists already (a pending key is never replaced silently) or if a device recovery or a routine rotation is pending. The active key is not touched.
Stores the replacement key pair of a device recovery. Throws IllegalStateException if one exists already (a pending key is never replaced silently) or if a routine rotation or a last-device recovery is pending. The active key is not touched.
Stores the replacement key pair of a routine rotation. Throws IllegalStateException if one exists already (a pending key is never replaced silently) or if a device recovery or a last-device recovery is pending. The active key is not touched.