signer

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BasicDateFormat     = "20060102T150405Z"
	Algorithm           = "SDK-HMAC-SHA256"
	HeaderXDate         = "X-Sdk-Date"
	HeaderHost          = "host"
	HeaderAuthorization = "Authorization"
	HeaderContentSha256 = "X-Sdk-Content-Sha256"
)

Variables

This section is empty.

Functions

func AuthHeaderValue

func AuthHeaderValue(signature, accessKey string, signedHeaders []string) string

Get the finalized value for the "Authorization" header. The signature parameter is the output from SignStringToSign

func CanonicalHeaders

func CanonicalHeaders(r *request.DefaultHttpRequest, signerHeaders []string) string

CanonicalHeaders

func CanonicalQueryString

func CanonicalQueryString(r *request.DefaultHttpRequest) string

CanonicalQueryString

func CanonicalRequest

func CanonicalRequest(r *request.DefaultHttpRequest, signedHeaders []string) (string, error)

func CanonicalURI

func CanonicalURI(r *request.DefaultHttpRequest) string

CanonicalURI returns request uri

func HexEncodeSHA256Hash

func HexEncodeSHA256Hash(body []byte) (string, error)

HexEncodeSHA256Hash returns hexcode of sha256

func Sign

func Sign(r *request.DefaultHttpRequest, ak string, sk string) (map[string]string, error)

SignRequest set Authorization header

func SignStringToSign

func SignStringToSign(stringToSign string, signingKey []byte) (string, error)

Create the HWS Signature.

func SignedHeaders

func SignedHeaders(headers map[string]string) []string

SignedHeaders

func StringToSign

func StringToSign(canonicalRequest string, t time.Time) (string, error)

Create a "String to Sign".

Types

This section is empty.

Jump to

Keyboard shortcuts

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