[][src]Struct pwbox::ErasedPwBox

pub struct ErasedPwBox { /* fields omitted */ }

Password-encrypted box suitable for (de)serialization.

Serialization

When used with a human-readable format (JSON, YAML, TOML, ...), the pwbox is serialized as the following structure:


const TOML: &str = r#"
ciphertext = 'cd9d2fb2355d8c60d92dcc860abc0c4b20ddd12dd52a4dd53caca0a2f87f7f5f'
mac = '83ae22646d7834f254caea78862eafda'
kdf = 'scrypt-nacl'
cipher = 'xsalsa20-poly1305'

[kdfparams]
salt = '87d68fb57d9c2331cf2bd9fdd7551057798bd36d0d2999481311cfae39863691'
memlimit = 16777216
opslimit = 524288

[cipherparams]
iv = 'db39c466e2f8ae7fbbc857df48d99254017b059624af7106'
"#;

let pwbox = toml::from_str(TOML).unwrap();
let pwbox = Eraser::new().add_suite::<Sodium>().restore(&pwbox).unwrap();
assert!(pwbox.open("correct horse battery staple").is_ok());

Implementations

impl ErasedPwBox[src]

pub fn len(&self) -> usize[src]

Returns the byte size of the encrypted data stored in this box.

Trait Implementations

impl Clone for ErasedPwBox[src]

impl Debug for ErasedPwBox[src]

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

impl Serialize for ErasedPwBox[src]

Auto Trait Implementations

impl RefUnwindSafe for ErasedPwBox

impl Send for ErasedPwBox

impl Sync for ErasedPwBox

impl Unpin for ErasedPwBox

impl UnwindSafe for ErasedPwBox

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.