Skip to main content

open

Function open 

Source
pub fn open(
    key: &EncryptionKey,
    ciphertext: &[u8],
    nonce: &[u8],
) -> Result<Vec<u8>, EncryptionError>
Expand description

Decrypt ciphertext using key and nonce.

On failure (wrong key, wrong nonce, or tampered ciphertext) returns EncryptionError::DecryptionFailed. Callers MUST surface this as oauth_needs_reauth, not internal_error.