Function encrypt_file

Source
pub fn encrypt_file(
    plain: &[u8],
    path: &Path,
    key: &Key,
) -> Result<(), WriteError>
Expand description

Put magic and version bytes as file-header, encrypt_content the specified plaintext to the specified path.

This is achieved by creating a temporary file in the same directory as the specified path (same filename with a salted suffix). This is currently known to be problematic if the path is a symlink and/or if the target path resides in a directory without user write permission.