Documentation ¶
Index ¶
- Constants
- func Sign(req *request.DefaultHttpRequest, ak, sk string) (map[string]string, error)
- func SignDerived(r *request.DefaultHttpRequest, ak string, sk string, ...) (map[string]string, error)
- type DerivedSigner
- type IAKSKSigner
- type ISigningKey
- type P256SHA256Signer
- type P256SigningKey
- type SM2SM3Signer
- type SM2SigningKey
- type SM3Signer
- type Signer
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 ¶
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 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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.