Skip to main content

encrypt_blob_cipher

Function encrypt_blob_cipher 

Source
pub(crate) fn encrypt_blob_cipher(
    view: &mut CipherView,
    ctx: &mut KeyStoreContext<'_, KeySlotIds>,
) -> Result<Cipher, BlobEncryptionError>
Expand description

Encrypts a CipherView into a blob-encrypted Cipher.

Generates a cipher key if missing, seals the sensitive data into a single blob, and encrypts attachments and local data separately. The outer wrapping key is derived from view.key_identifier(); see encrypt_blob_cipher_with_wrapping_key for the rotation case where the caller supplies an explicit wrapping key.