Skip to main content

seal_metadata_blob

Function seal_metadata_blob 

Source
pub fn seal_metadata_blob(
    amk: &Amk,
    blob_id: &Uuid,
    plaintext: &[u8],
    replaces: Option<[u8; 12]>,
) -> Result<(Vec<u8>, [u8; 32]), CryptoError>
Expand description

Seal plaintext (canonical CBOR sidecar) into a metadata blob under amk scoped to blob_id: draw a fresh blob nonce, fold it into the blob-key salt, and AEAD-seal.

replaces is the prior blob’s nonce on a metadata-update, refused if drawn again. Returns the wire bytes and the derived blob key (for the immediate binding self-check).