signer

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DerivationAlgorithm = "V11-HMAC-SHA256"
	DerivedDateFormat   = "20060102"
)
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 DerivationAuthHeaderValue added in v0.0.79

func DerivationAuthHeaderValue(signature, accessKey string, info string, signedHeaders []string) string

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

func GetDerivationKey added in v0.0.79

func GetDerivationKey(accessKey string, secretKey string, info string) (string, error)

Get the derivation key for derived credential.

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 SignDerived added in v0.0.79

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

SignDerived 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".

func StringToSignDerived added in v0.0.79

func StringToSignDerived(canonicalRequest string, info string, t time.Time) (string, error)

StringToSignDerived 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