crypto

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCiphertextTooShort = errors.New("security crypto: ciphertext too short")

Functions

func CanonicalSignaturePayload

func CanonicalSignaturePayload(method, path, timestamp, nonce string, canonicalBody []byte) []byte

func DecryptAESGCM

func DecryptAESGCM(key, ciphertext, aad []byte) ([]byte, error)

func EncryptAESGCM

func EncryptAESGCM(key, plaintext, aad []byte) ([]byte, error)

func EqualHMACHex

func EqualHMACHex(a, b string) bool

func HMACSHA256Hex

func HMACSHA256Hex(secret, data []byte) string

func RandomBase64URL

func RandomBase64URL(n int) (string, error)

func RandomBytes

func RandomBytes(n int) ([]byte, error)

func RandomHex

func RandomHex(n int) (string, error)

func SHA256Hex

func SHA256Hex(data []byte) string

func SignHMACSHA256

func SignHMACSHA256(secret []byte, method, path, timestamp, nonce string, canonicalBody []byte) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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