crypto

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePresignedToken

func GeneratePresignedToken(secretKey, method, bucket, key string, expiresAt time.Time) string

GeneratePresignedToken creates a token for presigned URLs

func GenerateSignature

func GenerateSignature(secretKey, method, path, timestamp string) string

GenerateSignature creates an HMAC-SHA256 signature for a request

func HashSecret

func HashSecret(secret string) string

HashSecret creates a SHA-256 hash of a secret key for storage

func IsTimestampValid

func IsTimestampValid(timestamp string) bool

IsTimestampValid checks if a timestamp is within acceptable range (15 minutes)

func VerifyPresignedToken

func VerifyPresignedToken(secretKey, method, bucket, key string, expiresAt time.Time, token string) bool

VerifyPresignedToken verifies a presigned URL token

func VerifySecret

func VerifySecret(secret, hash string) bool

VerifySecret checks if a secret matches a stored hash

func VerifySignature

func VerifySignature(secretKey, method, path, timestamp, signature string) bool

VerifySignature verifies an HMAC-SHA256 signature

Types

This section is empty.

Jump to

Keyboard shortcuts

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