Skip to content

CookieSigningKey

[Source]

An HMAC-SHA256 signing key for use with SignedCookie.

Keys must be at least 32 bytes. Use generate to create a random key or create to wrap an existing one.

class val CookieSigningKey

Constructors

create

[Source]

Wrap an existing key. Errors if key is shorter than 32 bytes.

new val create(
  key: Array[U8 val] val)
: CookieSigningKey val^ ?

Parameters

Returns


generate

[Source]

Generate a 32-byte key from a cryptographically secure random source. Errors if the runtime cannot produce secure random bytes.

new val generate()
: CookieSigningKey val^ ?

Returns