Create an HMACAuthenticatedPayload object using the supplied payload, nonce and HMAC.
Arbitrary JSON-stringifiable data.
A cryptographic nonce.
An HMAC tag in base64 encoding.
An HMAC tag in base64 encoding.
A cryptographic nonce.
Arbitrary JSON-stringifiable data.
Computes the correct HMAC of this object and compares it to the stored HMAC. Returns true if and only if they coincide.
Computes the correct HMAC of the supplied payload, nonce.
A cryptographic key. Should be exactly 64 bytes long.
Arbitrary JSON-stringifiable data.
A cryptographic nonce. If no nonce is provided, the current UNIX timestamp (in milliseconds) is used.
Create a valid HMACAuthenticatedPayload object using the supplied key, payload and (optionally) a user defined nonce. If no nonce is supplied, the current UNIX timestamp (in milliseconds) will be used as nonce.
A cryptographic key. Should be exactly 64 bytes long.
Arbitrary JSON-stringifiable data.
A cryptographic nonce. If no nonce is provided, the current UNIX timestamp (in milliseconds) is used.
Creates a new (random) 64 byte key to be used as HMAC key.
Computes the correct HMAC of the supplied payload, nonce and compares it to the supplied HMAC. Returns true if and only if they coincide.
Generated using TypeDoc
A wrapper to authenticate an object (the 'payload') using a SHA3-512 HMAC tag. Computation of the HMAC includes a nonce to support prevention of replay attacks. The input to the HMAC is the concatenation of the nonce, "." and the base64-encoding of the JSON.stringification of the payload.