Documentation
¶
Overview ¶
Package httpsig implements the OCM profile of RFC 9421 HTTP Message Signatures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsigned = errors.New("the request has no OCM signature")
ErrUnsigned is returned by Verify for a request without an OCM signature.
Functions ¶
func Verify ¶
Verify checks the OCM signature of r. body is the request body, which r no longer holds. endpoint is the public URL of this server. Verify takes the scheme and the host from it, because the client sets Host: a server that got a request signed for its own URL could send it to us with its own Host. jwks returns the JWK Set of the signer. Verify calls it only for a signed request, thus an unsigned request does not cause a fetch.
Types ¶
type Key ¶
type Key struct {
// ID is the keyid of the signatures and the kid of the published key.
ID string
// contains filtered or unexported fields
}
Key is the private key that this server uses to sign OCM requests.
func LoadKey ¶
LoadKey reads an Ed25519 private key from a PKCS#8 PEM file, such as the output of `openssl genpkey -algorithm ed25519`.