Struct keybob::Key[][src]

pub struct Key { /* fields omitted */ }

A crytographic key of a certain type

Uses a union to allow key inlining without heap allocation. Provides easy to use constructors for generation and derivation from user input/name.

Also implements serde::{Serialize, Deserialize} via a custom serialiser which allows easy encryption of the key itself.

Methods

impl Key
[src]

Generate a new, completely random key of a certain type

Generate a new key based on a user password

This function uses the pbkdf2 algorithm to deterministically expand an input pw/username combination into a key.

Read the key as an imutable slice

Read the key as a mutable slice

Return the length of the key in bytes

Trait Implementations

impl Serialize for Key
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for Key
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Clone for Key
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Key
[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 Key
[src]

impl Debug for Key
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Key

impl Sync for Key