sign


Description:


[ Version ( since = "0.3" ) ]
public void sign (Cookie cookie, ChecksumType checksum_type, uint8[] key)

Sign the provided cookie name and value in-place using HMAC.

The returned value will be 'HMAC(checksum_type, name + HMAC(checksum_type, value)) + value' suitable for a cookie value which can the be verified with VSGI.CookieUtils.verify.

CookieUtils.sign (cookie, ChecksumType.SHA512, "super-secret".data);

Parameters:

cookie

cookie to sign

checksum_type

hash algorithm used to compute the HMAC

key

secret used to sign the cookie name and value


Namespace: VSGI.CookieUtils
Package: vsgi-0.3