commons

package
v0.0.0-...-625ab12 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHTTPRequestHash

func GenerateHTTPRequestHash(r *http.Request, timestamp int64) ([]byte, error)

GenerateHTTPRequestHash retrieves a sha256 from the following message: request method + request url + timestamp + request body

func GenerateMessageHash

func GenerateMessageHash(message []byte, timestamp int64) ([]byte, error)

GenerateMessageHash retrieves a sha256 from the following message: timestamp + message

func ReadRequestBody

func ReadRequestBody(r *http.Request) ([]byte, error)

ReadRequestBody reads the request content into a byte array

func SignMessage

func SignMessage(msg []byte, privKey *ecdsa.PrivateKey) ([]byte, error)

SignMessage sign msg using privKey

Types

This section is empty.

Jump to

Keyboard shortcuts

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