CryptoRuntime
class CryptoRuntime(stack: PlatformCryptoStack, storeRegistry: StoreRegistry = StoreRegistry(), log: KryptoLog = KryptoLog.NoOp)
Initializes platform crypto (key rotation + re-encrypt + post-init hooks) behind a mutex.
cipher is only safe to use after state is CryptoRuntimeState.Ready.
On rotation the order is: rotate → postRotationInit → StoreRegistry.reEncryptAll → postMigrationCleanup → Ready (REQ-ROT-02). Re-encrypt runs before cleanup so old key material can still decrypt existing ciphertext (notably iOS SecureKeyStore).
Constructors
Link copied to clipboard
constructor(stack: PlatformCryptoStack, storeRegistry: StoreRegistry = StoreRegistry(), log: KryptoLog = KryptoLog.NoOp)
constructor(keyRotator: KeyRotator, postRotationInit: suspend () -> Unit, postMigrationCleanup: suspend () -> Unit = {}, cipher: Cipher, storeRegistry: StoreRegistry = StoreRegistry(), log: KryptoLog = KryptoLog.NoOp)