httpsig

package
v0.0.0-...-ec5862a Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package httpsig implements HTTP signatures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(r *http.Request, key Key) error

Sign adds a signature to an outgoing HTTP request.

Types

type Key

type Key struct {
	ID         string
	PrivateKey any
}

Key is used to sign outgoing HTTP requests.

type Signature

type Signature struct {
	KeyID string
	// contains filtered or unexported fields
}

func Extract

func Extract(r *http.Request, body []byte, domain string, maxAge time.Duration) (*Signature, error)

Extract extracts signature attributes and returns a Signature. Caller should obtain the key and pass it to Signature.Verify.

func (*Signature) Verify

func (s *Signature) Verify(key any) error

Verify verifies a signature.

Jump to

Keyboard shortcuts

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