Documentation ¶
Index ¶
- Constants
- func AuthHeaderValue(signature, accessKey string, signedHeaders []string) string
- func CanonicalHeaders(r *request.DefaultHttpRequest, signerHeaders []string) string
- func CanonicalQueryString(r *request.DefaultHttpRequest) string
- func CanonicalRequest(r *request.DefaultHttpRequest, signedHeaders []string) (string, error)
- func CanonicalURI(r *request.DefaultHttpRequest) string
- func DerivationAuthHeaderValue(signature, accessKey string, info string, signedHeaders []string) string
- func GetDerivationKey(accessKey string, secretKey string, info string) (string, error)
- func HexEncodeSHA256Hash(body []byte) (string, error)
- func Sign(r *request.DefaultHttpRequest, ak string, sk string) (map[string]string, error)
- func SignDerived(r *request.DefaultHttpRequest, ak string, sk string, ...) (map[string]string, error)
- func SignStringToSign(stringToSign string, signingKey []byte) (string, error)
- func SignedHeaders(headers map[string]string) []string
- func StringToSign(canonicalRequest string, t time.Time) (string, error)
- func StringToSignDerived(canonicalRequest string, info string, t time.Time) (string, error)
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 ¶
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
Get the derivation key for derived credential.
func HexEncodeSHA256Hash ¶
HexEncodeSHA256Hash returns hexcode of sha256
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 ¶
Create the HWS Signature.
func StringToSign ¶
Create a "String to Sign".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.