[][src]Trait keybear_core::crypto::StaticSecretExt

pub trait StaticSecretExt {
    pub fn verify_file<P>(file: P) -> bool
    where
        P: AsRef<Path>
;
pub fn new_with_os_rand() -> StaticSecret;
pub fn from_file<P>(file: P) -> Result<StaticSecret>
    where
        P: AsRef<Path>
;
pub fn save<P>(&self, file: P) -> Result<()>
    where
        P: AsRef<Path>
; pub fn from_file_or_generate<P>(file: P) -> Result<StaticSecret>
    where
        P: AsRef<Path>
, { ... } }

Add functions to the crypto secret key to make it easier to use.

Required methods

pub fn verify_file<P>(file: P) -> bool where
    P: AsRef<Path>, 
[src]

Check whether there is a file containing the crypto keys.

pub fn new_with_os_rand() -> StaticSecret[src]

Generate a new secret key with the OS random number generator.

pub fn from_file<P>(file: P) -> Result<StaticSecret> where
    P: AsRef<Path>, 
[src]

Try to load the crypto keys from our file on the disk.

pub fn save<P>(&self, file: P) -> Result<()> where
    P: AsRef<Path>, 
[src]

Save the crypto keys to the file on the disk.

Loading content...

Provided methods

pub fn from_file_or_generate<P>(file: P) -> Result<StaticSecret> where
    P: AsRef<Path>, 
[src]

Try to load the crypto key or generate a new one.

Loading content...

Implementations on Foreign Types

impl StaticSecretExt for StaticSecret[src]

Loading content...

Implementors

Loading content...