signer

package
v0.1.103 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DerivedDateFormat = "20060102"
	AlgorithmV11      = "V11-HMAC-SHA256"
)
View Source
const (
	BasicDateFormat     = "20060102T150405Z"
	HeaderXDate         = "X-Sdk-Date"
	HeaderHost          = "host"
	HeaderAuthorization = "Authorization"
)

Variables

This section is empty.

Functions

func Sign

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

func SignDerived added in v0.0.79

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

Types

type DerivedSigner added in v0.1.61

type DerivedSigner struct {
}

func GetDerivedSigner added in v0.1.61

func GetDerivedSigner() DerivedSigner

func (DerivedSigner) Sign added in v0.1.61

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

Sign SignRequest set Authorization header

type IAKSKSigner added in v0.1.61

type IAKSKSigner interface {
	Sign(req *request.DefaultHttpRequest, ak, sk string) (map[string]string, error)
}

func GetSigner added in v0.1.61

func GetSigner(alg algorithm.SigningAlgorithm) (IAKSKSigner, error)

type ISigningKey added in v0.1.61

type ISigningKey interface {
	Sign(data []byte) ([]byte, error)
	Verify(signature, data []byte) bool
}

type P256SHA256Signer added in v0.1.61

type P256SHA256Signer struct {
}

func (P256SHA256Signer) GetSigningKey added in v0.1.61

func (s P256SHA256Signer) GetSigningKey(ak, sk string) (ISigningKey, error)

GetSigningKey get the derived key based on ak and sk.

func (P256SHA256Signer) Sign added in v0.1.61

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

type P256SigningKey added in v0.1.61

type P256SigningKey struct {
	// contains filtered or unexported fields
}

func (P256SigningKey) Sign added in v0.1.61

func (k P256SigningKey) Sign(data []byte) ([]byte, error)

func (P256SigningKey) Verify added in v0.1.61

func (k P256SigningKey) Verify(signature, data []byte) bool

type SM2SM3Signer added in v0.1.61

type SM2SM3Signer struct {
}

func (SM2SM3Signer) GetSigningKey added in v0.1.61

func (s SM2SM3Signer) GetSigningKey(ak, sk string) (ISigningKey, error)

func (SM2SM3Signer) Sign added in v0.1.61

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

type SM2SigningKey added in v0.1.61

type SM2SigningKey struct {
	// contains filtered or unexported fields
}

func (SM2SigningKey) Sign added in v0.1.61

func (k SM2SigningKey) Sign(data []byte) ([]byte, error)

func (SM2SigningKey) Verify added in v0.1.61

func (k SM2SigningKey) Verify(signature, data []byte) bool

type SM3Signer added in v0.1.61

type SM3Signer struct {
}

func (SM3Signer) Sign added in v0.1.61

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

type Signer added in v0.1.61

type Signer struct {
}

func (Signer) Sign added in v0.1.61

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

Sign SignRequest set Authorization header

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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