hmac

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

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.

Index

Constants

View Source
const (
	MD5        = "MD5"
	SHA1       = "SHA1"
	SHA224     = "SHA224"
	SHA256     = "SHA256"
	SHA384     = "SHA384"
	SHA512     = "SHA512"
	SHA512_224 = "SHA512_224"
	SHA512_256 = "SHA512_256"
)

Variables

This section is empty.

Functions

func Sign

func Sign(hashName string, key []byte, data []byte) ([]byte, error)

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".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL