Struct fernet::Fernet [] [src]

pub struct Fernet { /* fields omitted */ }

Methods

impl Fernet
[src]

Fernet encapsulates encrypt and decrypt operations for a particular key.

[src]

Returns a new fernet instance with the provided key. The key should be 32-bytes, base64-encoded. Generating keys with Fernet::generate_key is recommended. DO NOT USE A HUMAN READABLE PASSWORD AS A KEY. Returns None if the key is not 32-bytes base64 encoded.

[src]

Generates a new, random, key. Can be safely passed to Fernet::new(). Store this somewhere safe!

[src]

Encrypts data. Returns a value (which is base64-encoded) that can be passed to Fernet::decrypt.

[src]

Decrypts a ciphertext. Returns either Ok(plaintext) if decryption is successful or Err(DecryptionError) if there are any errors.

Trait Implementations

Auto Trait Implementations

impl Send for Fernet

impl Sync for Fernet