signer

package
v0.0.10-beta Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 22 Imported by: 0

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

This section is empty.

Types

type DerivedSigner

type DerivedSigner struct {
}

func GetDerivedSigner

func GetDerivedSigner() DerivedSigner

func (DerivedSigner) Sign

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

Sign SignRequest set Authorization header

type IAKSKSigner

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

func GetSigner

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

type ISigningKey

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

type P256SHA256Signer

type P256SHA256Signer struct {
}

func (P256SHA256Signer) GetSigningKey

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

GetSigningKey get the derived key based on ak and sk.

func (P256SHA256Signer) Sign

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

type P256SigningKey

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

func (P256SigningKey) Sign

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

func (P256SigningKey) Verify

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

type SM2SM3Signer

type SM2SM3Signer struct {
}

func (SM2SM3Signer) GetSigningKey

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

func (SM2SM3Signer) Sign

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

type SM2SigningKey

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

func (SM2SigningKey) Sign

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

func (SM2SigningKey) Verify

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

type SM3Signer

type SM3Signer struct {
}

func (SM3Signer) Sign

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

type Signer

type Signer struct {
}

func (Signer) Sign

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