bitseal

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolHeader = "BitSeal"

Variables

This section is empty.

Functions

func BodyHashHex

func BodyHashHex(body string) string

BodyHashHex returns SHA256(body) in hex or empty string if body is empty

func BuildCanonicalString

func BuildCanonicalString(method, uriPath, query, body, timestamp, nonce string) string

BuildCanonicalString joins components with newline

func CanonicalQueryString

func CanonicalQueryString(q string) string

CanonicalQueryString implements RFC3986 key-sort encoding

func RandomNonce

func RandomNonce() (string, error)

RandomNonce returns 128-bit random hex string (32 characters)

func SignRequest

func SignRequest(method, uriPath, query, body string, clientPriv *ec.PrivateKey, serverPub *ec.PublicKey) (map[string]string, error)

SignRequest constructs headers for a BitSeal request

func VerifyRequest

func VerifyRequest(method, uriPath, query, body string, headers map[string]string, serverPriv *ec.PrivateKey) (bool, error)

VerifyRequest checks headers, returns true if signature OK

Types

This section is empty.

Jump to

Keyboard shortcuts

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