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§
- Private
Key - An RSA private key, parsed and ready to sign with.
- Signed
Get - Headers produced by
sign_getfor an authorized-fetch GET request. - Signed
Headers - Headers produced by
sign_requestthat 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_pemreads. - key_
id_ from_ header - Extract the
keyIdURI from a rawSignatureheader 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_getwith a key parsed once byPrivateKey::from_pem.- sign_
request - Sign an outgoing HTTP POST request body using RSA-SHA256.
- sign_
request_ with_ key sign_requestwith a key parsed once byPrivateKey::from_pem.- verify_
request - Verify the HTTP Signature on an incoming POST request.