StorageKeyRotationState

The persisted storage key rotation state of one storage, validated. Key IDs only. Each phase carries exactly the key IDs it needs, so an inconsistent combination cannot be represented. highestKeyId is the key ID high-water mark: IDs are allocated above it, never reused and never wrapped around.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Migrating(val currentKeyId: StorageKeyId, val highestKeyId: StorageKeyId, val retiringKeyId: StorageKeyId) : StorageKeyRotationState

currentKeyId seals new records; records of retiringKeyId are re-encrypted. Both keys are needed.

Link copied to clipboard
data class Preparing(val currentKeyId: StorageKeyId, val highestKeyId: StorageKeyId, val nextKeyId: StorageKeyId) : StorageKeyRotationState

nextKeyId is allocated; the provider key may not exist yet. currentKeyId is unchanged.

Link copied to clipboard
data class Retiring(val currentKeyId: StorageKeyId, val highestKeyId: StorageKeyId, val retiringKeyId: StorageKeyId) : StorageKeyRotationState

No record uses retiringKeyId (proven); its provider key may already be gone.

Link copied to clipboard
data class Stable(val currentKeyId: StorageKeyId, val highestKeyId: StorageKeyId) : StorageKeyRotationState

One key: every record uses currentKeyId.

Properties

Link copied to clipboard

The key that seals every new record.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The keys storage must load (and prove) to open in this state.