Skip to main content

initialize_user_local_data_key

Function initialize_user_local_data_key 

Source
async fn initialize_user_local_data_key(
    client: &Client,
) -> Result<(), EncryptionSettingsError>
Expand description

Ensures the SymmetricKeyId::LocalUserData key is loaded into the key store context.

On first call the key is generated (wrapping the user key with itself) and persisted to state. Subsequent calls are idempotent: if the key already exists in state it is loaded as-is, preserving any data that was previously encrypted with it (e.g. after a key rotation).