hmacvalidator

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateHmac

func CalculateHmac(data interface{}, secret string) (string, error)

CalculateHmac calculates the SHA-256 HMAC for the given data and key

func GetDataToSign

func GetDataToSign(notificationRequestItem interface{}) string

GetDataToSign converts a notification request item to string, which later on can be used for calculating a HMAC

func ValidateHmac

func ValidateHmac(notificationRequestItem notification.NotificationRequestItem, key string) bool

ValidateHmac calculates the HMAC of the notification request item and checks if it matches with the given key

Types

This section is empty.

Jump to

Keyboard shortcuts

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