Struct seckey::SecKey [] [src]

pub struct SecKey<T: Sized> { /* fields omitted */ }

Secure Key.

The use memsec/malloc protection secret bytes. When you need the password stored in the memory, you should use it.

More docs see Secure memory · libsodium.

Methods

impl<T> SecKey<T> where T: Sized
[src]

Borrow Read.

use seckey::SecKey;

let mut pass: [u8; 8] = [8; 8];
let secpass = SecKey::new(&pass).unwrap();
assert_eq!(pass, *secpass.read());

Borrow Write.

let mut wpass = secpass.write();
wpass[0] = 0;
assert_eq!([0, 8, 8, 8, 8, 8, 8, 8], *wpass);

Trait Implementations

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

Performs the conversion.

impl<T> Debug for SecKey<T>
[src]

Formats the value using the given formatter.

impl<T> Drop for SecKey<T>
[src]

A method called when the value goes out of scope. Read more