crypto/hmac

CUE v0.18.0

Package hmac implements the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198.

An HMAC is a cryptographic hash that uses a key to sign a message. The receiver verifies the hash by recomputing it using the same key.

Constants

MD5

cue
MD5: "MD5"

SHA1

cue
SHA1: "SHA1"

SHA224

cue
SHA224: "SHA224"

SHA256

cue
SHA256: "SHA256"

SHA384

cue
SHA384: "SHA384"

SHA512

cue
SHA512: "SHA512"

SHA512_224

cue
SHA512_224: "SHA512_224"

SHA512_256

cue
SHA512_256: "SHA512_256"

Functions

Sign

cue
Sign: func(hashName: string, key: bytes | string, data: bytes | string) -> bytes

Sign returns the HMAC signature of the data, using the provided key and hash function.

Supported hash functions: "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512", "SHA512_224", and "SHA512_256".

Install CUE