hmac

package
v0.0.0-...-fc6107d Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(secretKey string, data interface{}) (string, error)

Function to generate an HMAC signature (client-side) This will take any data type (interface{}) and serialize it into a JSON string for signing

func Verify

func Verify(secretKey string, data interface{}, providedSignature string) (bool, error)

Function to verify the HMAC signature (server-side) It compares the provided HMAC signature with the generated HMAC for the serialized data

func VerifyRequestBody

func VerifyRequestBody(w http.ResponseWriter, r *http.Request, txn interface{}) bool

VerifyRequestBody reads and verifies the request body and HMAC signature

Types

This section is empty.

Jump to

Keyboard shortcuts

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