Skip to main content

unseal_file_key

Function unseal_file_key 

Source
pub fn unseal_file_key(
    amk: &Amk,
    file_id: &Uuid,
    wrapped: &[u8],
) -> Result<[u8; 32], CryptoError>
Expand description

Recover the file key K from a wrapped_file_key under amk, scoped to file_id.

Fail-closed: a wrong length is CryptoError::Malformed; a wrong AMK / file_id, a tampered nonce, or a tampered ciphertext all fail AEAD authentication (CryptoError::Auth) — the same terminal rejection any tampered signed field earns.