CookieKey
struct CookieKey
A cryptographic master key for use with Signed and/or Private jars.
Methods
Returns the bytes of the key.
Returns the bytes of the key.
Returns the bytes of the key.
Example
nv
use std.rand;
use std.net.http.CookieKey;
let key_data = rand.bytes(64);
let key = try! CookieKey.from_bytes(key_data);
assert_eq key.bytes(), key_data;
from_bytes
pub fn from_bytes(data: Bytes): CookieKey throws CookieKeyError
Creates a new Key from a 512-bit cryptographically random bytes.
from_bytes
pub fn from_bytes(data: Bytes): CookieKey throws CookieKeyError
Creates a new Key from a 512-bit cryptographically random bytes.
Creates a new Key from a 512-bit cryptographically random bytes.
Example
nv
use std.rand;
use std.net.http.CookieKey;
let key = try! CookieKey.from_bytes(rand.bytes(64));
Generates signing/encryption keys from a secure, random source. Keys are
generated nondeterministically.
Generates signing/encryption keys from a secure, random source. Keys are generated nondeterministically.
Generates signing/encryption keys from a secure, random source. Keys are generated nondeterministically.
Example
nv
use std.net.http.CookieKey;
let key = CookieKey.generate();