SignedCookie¶
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.
Constructors¶
create¶
Returns¶
- SignedCookie val^
Public Functions¶
sign¶
Sign value and return the signed string value.signature.
Parameters¶
- key: CookieSigningKey val
- value: String val
Returns¶
- String val
verify¶
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¶
- key: CookieSigningKey val
- signed_value: String val
Returns¶
- (String val | MalformedSignedValue val | InvalidSignature val)
eq¶
Parameters¶
- that: SignedCookie val
Returns¶
- Bool val
ne¶
Parameters¶
- that: SignedCookie val
Returns¶
- Bool val