pub fn try_generate() -> Option<Key> {
        use crate::secure::rand::RngCore;

        let mut rng = crate::secure::rand::thread_rng();
        let mut both_keys = [0; SIGNED_KEY_LEN + PRIVATE_KEY_LEN];
        rng.try_fill_bytes(&mut both_keys).ok()?;
        Some(Key::from(&both_keys))
    }
/// Attempts to generate signing/encryption keys from a secure, random
/// source. Keys are generated nondeterministically. If randomness cannot be
/// retrieved from the underlying operating system, returns `None`.
///
/// # Example
///
/// ```rust
/// use cookie::Key;
///
/// let key = Key::try_generate();
/// ```
Attempts to generate signing/encryption keys from a secure, random
source. Keys are generated nondeterministically. If randomness cannot be
retrieved from the underlying operating system, returns `None`.
Attempts to generate signing / encryption keys from a secure random source . Keys are generated nondeterministically . If randomness cannot be retrieved from the underlying operating system returns ` None ` .
pub fn try_generate() -> Option<Key> {
        use crate::secure::rand::RngCore;
        let mut rng = crate::secure::rand::thread_rng();
        let mut both_keys = [0; SIGNED_KEY_LEN + PRIVATE_KEY_LEN];
        rng.try_fill_bytes(&mut both_keys).ok()?;
        Some(Key::from(&both_keys))
    }
pub fn try_generate ( ) -> Option < Key > { use crate :: secure :: rand :: RngCore ; let mut rng = crate :: secure :: rand :: thread_rng ( ) ; let mut both_keys = [ 0 ; SIGNED_KEY_LEN + PRIVATE_KEY_LEN ] ; rng . try_fill_bytes ( & mut both_keys ) . ok ( ) ? ; Some ( Key :: from ( & both_keys ) ) }
Attempts to generate signing/encryption keys from a secure, random
source.
Attempts to generate signing / encryption keys from a secure random source .
example
```rust
use cookie::Key.

let key = Key::try_generate();
```
` ` ` rust use cookie :: Key . let key = Key :: try_generate () ; ` ` `