v4

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimeFormat is the full-width form to be used in the X-Amz-Date header.
	TimeFormat = "20060102T150405Z"

	// ShortTimeFormat is the shortened form used in credential scope.
	ShortTimeFormat = "20060102"
)

Variables

This section is empty.

Functions

func ResolveTime

func ResolveTime(t time.Time) time.Time

ResolveTime initializes a time value for signing.

func Stosha

func Stosha(s string) []byte

Stosha computes the sha256 hash of the given string.

Types

type Finalizer

type Finalizer interface {
	SignString(string) (string, error)
}

Finalizer performs the final step in v4 signing, deriving a signature for the string-to-sign with algorithm-specific key material.

type Signer

type Signer struct {
	Request     *http.Request
	PayloadHash []byte
	Time        time.Time
	Credentials credentials.Credentials
	Options     v4.SignerOptions

	// variant-specific inputs
	Algorithm       string
	CredentialScope string
	Finalizer       Finalizer

	SignatureType v4.SignatureType
}

Signer is the implementation structure for all variants of v4 signing.

func (*Signer) Do

func (s *Signer) Do() error

Do performs v4 signing, modifying the request in-place with the signature.

Do should be called exactly once for a configured Signer. The behavior of doing otherwise is undefined.

Jump to

Keyboard shortcuts

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