pub fn encode(
master_key_bytes: &[u8],
key_id: &str,
plaintext: &[u8],
) -> Vec<u8> ⓘExpand description
Encode a plaintext byte slice into the AWS-shaped blob format. Uses AES-256-GCM with the supplied 32-byte master key and a fresh random IV. Output bytes are opaque — callers should base64 them before placing in JSON responses. Panics on a master key that isn’t 32 bytes; callers control the key, so this is a programming error.