Skip to main content

decrypt_for_blob_upgrade

Function decrypt_for_blob_upgrade 

Source
fn decrypt_for_blob_upgrade(
    cipher: &Cipher,
    current_key: SymmetricKeySlotId,
    new_key: SymmetricKeySlotId,
    ctx: &mut KeyStoreContext<'_, KeySlotIds>,
) -> Result<CipherView, DataReencryptionError>
Expand description

Decrypts a legacy cipher into a view that can be re-sealed as a blob under new_key.

If the cipher has a per-item key, it is re-wrapped under the new user key first so the cipher key (and the data sealed against it) stay consistent under the new key. Otherwise the cipher is decrypted under the current key and blob sealing will generate a fresh per-item key.