httpsig

package
v0.0.0-...-e279f7d Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(req *http.Request, bodyBytes []byte, signingKey *jwk.JWK, digestName string) (*http.Request, error)

Types

type Signer

type Signer struct {
	SigningKey *jwk.JWK
}

Signer signs GNAP http requests using http-signature.

func (*Signer) ProofType

func (s *Signer) ProofType() string

ProofType returns "httpsig", the GNAP proof type of the http-signature proof method.

func (*Signer) Sign

func (s *Signer) Sign(request *http.Request, requestBody []byte) (*http.Request, error)

Sign signs the given request using sha-256 for a content digest, and http-signature to sign headers.

type Verifier

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

Verifier verifies that the client request is signed by the client key, using http-signature verification.

func NewVerifier

func NewVerifier(req *http.Request) *Verifier

NewVerifier initializes an http-signature Verifier on the given client request.

func (*Verifier) Verify

func (v *Verifier) Verify(key *gnap.ClientKey) error

Verify verifies that the Verifier's client request is signed by the client key, using http-signature verification.

Jump to

Keyboard shortcuts

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