Struct serde_encrypted_value::Key [] [src]

pub struct Key(_);

A key used to encrypt or decrypt values. It represents both an algorithm and a key.

The canonical serialized representation of a Key is a string consisting of an algorithm identifier, followed by a :, followed by the base64 encoded bytes of the key. The Display and FromStr implementations serialize and deserialize in this format.

The only algorithm currently supported is AES 256 GCM, which uses the identifier AES.

Methods

impl Key
[src]

Creates a random AES key.

A convenience function which deserializes a Key from a file.

If the file does not exist, None is returned. Otherwise, the contents of the file are parsed via Key's FromStr implementation.

Encrypts a string with this key.

Decrypts a string with this key.

Trait Implementations

impl Display for Key
[src]

Formats the value using the given formatter. Read more

impl FromStr for Key
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more