Documentation
¶
Index ¶
- Constants
- func BodyHashHex(body string) string
- func BuildCanonicalString(method, uriPath, query, body, timestamp, nonce string) string
- func CanonicalQueryString(q string) string
- func RandomNonce() (string, error)
- func SignRequest(method, uriPath, query, body string, clientPriv *ec.PrivateKey, ...) (map[string]string, error)
- func VerifyRequest(method, uriPath, query, body string, headers map[string]string, ...) (bool, error)
Constants ¶
View Source
const ProtocolHeader = "BitSeal"
Variables ¶
This section is empty.
Functions ¶
func BodyHashHex ¶
BodyHashHex returns SHA256(body) in hex or empty string if body is empty
func BuildCanonicalString ¶
BuildCanonicalString joins components with newline
func CanonicalQueryString ¶
CanonicalQueryString implements RFC3986 key-sort encoding
func RandomNonce ¶
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.
Click to show internal directories.
Click to hide internal directories.