Skip to content

SignedCookie

[Source]

Signs and verifies cookie values using HMAC-SHA256.

The signed format is value.base64url(hmac). The value is readable (not encrypted); the signature proves integrity.

primitive val SignedCookie

Constructors

create

[Source]

new val create()
: SignedCookie val^

Returns


Public Functions

sign

[Source]

Sign value and return the signed string value.signature.

fun box sign(
  key: CookieSigningKey val,
  value: String val)
: String val

Parameters

Returns


verify

[Source]

Verify the signature on signed_value. Returns the original value on success, or a SignedCookieError describing the failure.

fun box verify(
  key: CookieSigningKey val,
  signed_value: String val)
: (String val | MalformedSignedValue val | InvalidSignature val)

Parameters

Returns


eq

[Source]

fun box eq(
  that: SignedCookie val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: SignedCookie val)
: Bool val

Parameters

Returns