decrypt_with_key

Function decrypt_with_key 

Source
pub fn decrypt_with_key(
    key_id: &str,
    ciphertext: &str,
    associated_data: Option<&[u8]>,
) -> Result<String>
Expand description

Decrypt text using a stored key from the key store

§Arguments

  • key_id - Identifier of the key to use for decryption
  • ciphertext - Base64-encoded encrypted text to decrypt
  • associated_data - Optional associated data (must match encryption)

§Returns

Decrypted plaintext as a string

§Errors

Returns an error if the key store is not initialized, the key is not found, or decryption fails