Struct seckey::SecKey [] [src]

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

Secure Key.

The use memsec/malloc protection secret bytes.

More docs see Secure memory · libsodium.

Methods

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

use seckey::SecKey;

let k = SecKey::new([1]).unwrap();
assert_eq!([1], *k.read());

use seckey::SecKey;

let mut v = [1];
let k = unsafe { SecKey::from_raw(&v).unwrap() };
assert_eq!([1], v);
assert_eq!([1], *k.read());

impl<T> SecKey<T>
[src]

Borrow Read.

use seckey::SecKey;

let secpass = SecKey::new([8u8; 8]).unwrap();
assert_eq!([8u8; 8], *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> Default for SecKey<T> where T: Default
[src]

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

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

Formats the value using the given formatter.

impl<T> Pointer 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