Validate decrypted source and map ciphertext to plaintext
dotenvx_primitives::decrypted_replacements
Usage
Returns a map from original ciphertexts to literal plaintext. Source and response assignments must match in order and count; unchanged plaintext assignments must remain unchanged. Invalid responses return BAD_REQUEST.
let pair = dotenvx_primitives::keypair(None)?;
let ciphertext = dotenvx_primitives::encrypt(&pair.public_key, "World")?;
let original = format!("HELLO={}", ciphertext);
let replacements = dotenvx_primitives::decrypted_replacements(&original, "HELLO=World")?;
assert_eq!(replacements[&ciphertext], "World");