hmac

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

HMAC Algorithm

Index

Constants

View Source
const (
	ErdaHeaderPrefix  = "X-Erda-"
	ErdaSignAlgorithm = ErdaHeaderPrefix + "Sign-Algorithm"
	ErdaSignTimestamp = ErdaHeaderPrefix + "Sign-Timestamp"
	ErdaAccessKeyID   = ErdaHeaderPrefix + "Ak"
	ErdaSignature     = ErdaHeaderPrefix + "Signature"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Signer)

func WithQueryStringMode

func WithQueryStringMode() Option

func WithTimestamp

func WithTimestamp(t time.Time) Option

type Signer

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

func New

func New(keyPair secret.AkSkPair, opts ...Option) *Signer

func (*Signer) GetSignString

func (s *Signer) GetSignString(r *http.Request) string

func (*Signer) SignCanonicalRequest

func (s *Signer) SignCanonicalRequest(r *http.Request)

Sign HTTP Request

func (*Signer) Signature

func (s *Signer) Signature(signString string) string

hash and get Signature

Jump to

Keyboard shortcuts

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