KeyMetadataStore

class KeyMetadataStore(context: Context, baseAlias: String)

Persistent storage for key version metadata.

Tracks key creation timestamps and version lifecycle to support key rotation and backward-compatible decryption.

Constructors

Link copied to clipboard
constructor(context: Context, baseAlias: String)

Functions

Link copied to clipboard
fun deleteKeyMetadata(version: Int)

Delete metadata for a key version.

Link copied to clipboard

Get all known key versions.

Link copied to clipboard

Calculate the age of the current key in days.

Link copied to clipboard

Get metadata for the current key version.

Link copied to clipboard

Get the current (active) key version.

Link copied to clipboard

Get metadata for a specific key version.

Link copied to clipboard

Initialize metadata for version 1 if not already present.

Link copied to clipboard
fun setCurrentVersion(version: Int)

Set the current (active) key version.

Link copied to clipboard
fun setKeyMetadata(version: Int, metadata: KeyMetadata)

Store metadata for a key version.