crypto

package
v0.0.0-...-bd40a71 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: BSD-3-Clause Imports: 11 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BearerHMAC

func BearerHMAC(payload []byte) []byte

func BearerVerify

func BearerVerify(payload []byte, signature []byte) bool

func DecryptWithExpiration

func DecryptWithExpiration(payload []byte, expiry time.Duration) []byte

func DecryptWithoutExpiration

func DecryptWithoutExpiration(payload []byte) []byte

func Encrypt

func Encrypt(payload []byte) []byte

func InitCrypto

func InitCrypto(config ini.File)

func Sign

func Sign(payload []byte) []byte

func SignWebhook

func SignWebhook(payload []byte) (string, string)

Signs the payload for a webhook, returning respectively the values for the X-Payload-Nonce and X-Payload-Signature headers.

func Verify

func Verify(payload, signature []byte) bool

func VerifyWebhook

func VerifyWebhook(payload []byte, nonce, signature string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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