pub fn encrypt_with_key(
key_id: &str,
plaintext: &str,
associated_data: Option<&[u8]>,
) -> Result<String>Expand description
Encrypt text using a stored key from the key store
§Arguments
key_id- Identifier of the key to use for encryptionplaintext- Text to encryptassociated_data- Optional associated data for authenticated encryption
§Returns
Base64-encoded encrypted ciphertext
§Errors
Returns an error if the key store is not initialized or the key is not found