httpsig

package
v0.14.1 Latest Latest
Warning

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

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

Documentation

Overview

Package httpsig provides RFC 9421 HTTP Message Signature signing and verification using SSH keys. It bridges the SSH key types used by epithet with the yaronf/httpsign library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

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

Signer signs HTTP requests using RFC 9421 with an SSH private key. It maintains separate internal signers for GET (no body) and POST (with content-digest) requests.

func NewSigner

func NewSigner(privateKey sshcert.RawPrivateKey) (*Signer, error)

NewSigner creates a Signer from an SSH private key.

func (*Signer) KeyID

func (s *Signer) KeyID() string

KeyID returns the SSH public key fingerprint used as the signature key ID.

func (*Signer) SignRequest

func (s *Signer) SignRequest(req *http.Request) error

SignRequest signs an HTTP request using RFC 9421. For requests with a body, it computes Content-Digest (SHA-256) first, then signs the request including the digest. Sets Signature, Signature-Input, and (for POST) Content-Digest headers.

type Verifier

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

Verifier verifies RFC 9421 signatures on HTTP requests using an SSH public key.

func NewVerifier

func NewVerifier(publicKey sshcert.RawPublicKey) (*Verifier, error)

NewVerifier creates a Verifier from an SSH public key.

func (*Verifier) VerifyRequest

func (v *Verifier) VerifyRequest(req *http.Request) error

VerifyRequest verifies an HTTP request's RFC 9421 signature. For POST requests, also validates Content-Digest against the actual body.

Jump to

Keyboard shortcuts

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