Struct safe_crypto::SymmetricKey[][src]

pub struct SymmetricKey { /* fields omitted */ }

Secret key for authenticated symmetric encryption.

Methods

impl SymmetricKey
[src]

Generates a new symmetric key.

Encrypts serialisable plaintext using authenticated symmetric encryption.

With authenticated encryption the recipient will be able to confirm that the message is untampered with. If you wish to encrypt bytestring plaintext, use encrypt_bytes.

Returns ciphertext in case of success. Can return an EncryptionError in case of a serialisation error.

Encrypts bytestring plaintext using authenticated symmetric encryption.

With authenticated encryption the recipient will be able to confirm that the message is untampered with.

Returns ciphertext in case of success. Can return an EncryptionError in case of a serialisation error.

Decrypts serialised ciphertext encrypted using authenticated symmetric encryption.

With authenticated encryption we will be able to tell that the message hasn't been tampered with.

Returns deserialised type T in case of success. Can return EncryptionError in case of a deserialisation error, if the ciphertext is not valid, or if it can not be decrypted.

Decrypts bytestring ciphertext encrypted using authenticated symmetric encryption.

With authenticated encryption we will be able to tell that the message hasn't been tampered with.

Returns plaintext in case of success. Can return EncryptionError in case of a deserialisation error, if the ciphertext is not valid, or if it can not be decrypted.

Trait Implementations

impl Debug for SymmetricKey
[src]

Formats the value using the given formatter. Read more

impl PartialEq for SymmetricKey
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for SymmetricKey
[src]

impl Clone for SymmetricKey
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for SymmetricKey
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations