Documentation
¶
Index ¶
- Constants
- Variables
- func NewRequestVerifier(req *http.Request, signatureParametersString string) (*verifier, error)
- func NewResponseVerifier(res *http.Response, signatureParametersString string) (*verifier, error)
- func SignRequest(req *http.Request, signOptions *SignOptions) error
- func SignResponse(res *http.Response, signOptions *SignOptions) error
- type SignOptions
- type VerifyOptions
Constants ¶
View Source
const ( RequestTarget = "(request-target)" Created = "(created)" Expires = "(expires)" HS2019 = "hs2019" // Special algorithm value DefaultExpiryTime = 60 // seconds )
Variables ¶
View Source
var ( ErrInvalidSignatureAlgorithm = errors.New("invalid signature algorithm") ErrUnsupportedHashAlgorithm = errors.New("unsupported hash algorithm") ErrUnsupportedKeyFormat = errors.New("unsupported key format") ErrSignatureExpired = errors.New("signature expired") ErrVerification = errors.New("verification error") ErrMissingPrivateKey = errors.New("missing private key") ErrMissingPublicKey = errors.New("missing public key") ErrAlgorithmMismatch = errors.New("algorithm mismatch for the given key") ErrInvalidCreationTime = errors.New("signature creation time is outside allowed clock skew") ErrRequiredHeaderMissing = errors.New("required header not listed in signature parameters") )
View Source
var ( DefaultRequestHeaderNames = []string{RequestTarget, "date", "digest", "host"} DefaultResponseHeaderNames = []string{"date", "digest"} )
Functions ¶
func NewRequestVerifier ¶
func NewResponseVerifier ¶
func SignRequest ¶
func SignRequest(req *http.Request, signOptions *SignOptions) error
func SignResponse ¶
func SignResponse(res *http.Response, signOptions *SignOptions) error
Types ¶
type SignOptions ¶
type SignOptions = common.SignOptions
type VerifyOptions ¶
type VerifyOptions = common.VerifyOptions
Click to show internal directories.
Click to hide internal directories.