Skip to main content

Module signature

Module signature 

Source
Expand description

HTTP Signature (draft-cavage-http-signatures) for ActivityPub federation.

Runtime-agnostic: it works with plain byte slices and (name, value) header pairs, so it can be used with any HTTP framework, and is given the time rather than reading a clock.

Structs§

PrivateKey
An RSA private key, parsed and ready to sign with.
SignedGet
Headers produced by sign_get for an authorized-fetch GET request.
SignedHeaders
Headers produced by sign_request that must be attached to the outgoing request.

Functions§

generate_rsa_keypair
A new RSA key pair for an actor, 2048 bits: the private key as PKCS#8 PEM and the public key as SPKI PEM, the forms actor documents publish and PrivateKey::from_pem reads.
key_id_from_header
Extract the keyId URI from a raw Signature header value.
sign_get
Sign an outgoing HTTP GET request using RSA-SHA256, for “authorized fetch” (secure mode) servers that require a signed dereference.
sign_get_with_key
sign_get with a key parsed once by PrivateKey::from_pem.
sign_request
Sign an outgoing HTTP POST request body using RSA-SHA256.
sign_request_with_key
sign_request with a key parsed once by PrivateKey::from_pem.
verify_request
Verify the HTTP Signature on an incoming POST request.