DeviceAuthenticationRotation
Routine device authentication key rotation, format version 1 (docs/device-authentication-rotation.md). All three constructions share the rotation statement:
u32 length | userId (UTF-8) | u32 length | deviceId (UTF-8)
current public key (32)
replacement public key (32)
expected authentication epoch: i64 (>= 1)
timestamp: i64, epoch milliseconds
nonce (16)and prefix it with u32 length | domain (UTF-8):
authorization, Ed25519 by the current key:
KSecureMessage-DeviceAuthRotation-v1;proof of possession, Ed25519 by the replacement key:
KSecureMessage-DeviceAuthRotation-PoP-v1;DeviceAuthenticationRotationId, SHA-256:
KSecureMessage-DeviceAuthRotationId-v1.
Integers are big-endian. The domains keep the three apart from each other, from device recovery and from server request signatures.
Properties
Size of a device authentication public key (Ed25519).
Size of a rotation signature (Ed25519).
Accepted clock difference in each direction: now - VALIDITY_WINDOW <= timestamp <= now + VALIDITY_WINDOW. The same as for server requests and device recovery.
Functions
The bytes the current key signs.
The statement for replacing current (registered for address at expectedAuthEpoch) with replacement, signed by both keys. timestamp is truncated to milliseconds. Throws IllegalArgumentException if both keys are the same.
The bytes the replacement key signs.
The ID of statement.
true if authorization's authorization signature verifies with currentPublicKey. The server passes the registered key. Does not check the proof of possession.
true if the proof of possession verifies with the statement's replacement key.