Skip to main content

Crate fiki

Crate fiki 

Source
Expand description

fiki — sign and verify HTTP requests with a bare Ed25519 key as the identifier.

Standard RFC 9421, with one lens: an Ed25519 public key is rendered as a non-transferable AID (CESR Ed25519N, a 44-character B… string), so the identifier is the verifying key and a verifier resolves nothing.

That is the default. A caller who speaks the KERI profile of RFC 9421 (docs/keri-profile.md) signs requests and responses under a KERI AID instead, and verifies them through a resolver it supplies, against a minimum covered set, with refusals in the profile’s section 9 order (this.i @7f28p7xk, @6g9zjsv9, @5e2phpjy).

See this.i @07wstqk7 in https://github.com/bakobo/fiki for why this is a library of its own.

Structs§

Error
Every error fiki returns about a request.
Key
An Ed25519 key pair whose public half is rendered as a non-transferable AID.
Request
The request a response answers, which a response’s req components are read from.
SignOptions
Everything about a signature beyond the message itself. The same options sign a request or a response; body is the content of whichever is being signed.
SignatureParams
The RFC 9421 signature parameters a signer sets.
Verdict
The outcome of a successful verification. An Err means it did not verify.
VerifyOptions
The verifier’s policy and the body it has in hand.

Enums§

Authorities
The @authority values a verifier serves, VerifyOptions::authorities (this.i @524c8qgv).
ExpectedKeyid
The keyid a verifier expects, VerifyOptions::expected_keyid (this.i @524c8qgv).
Kind
The condition a refusal names. The Display spelling is what the shared vectors pin.
MaxAge
The age a verifier tolerates, VerifyOptions::max_age (this.i @67shl6c5, @65u2932c).
Minimum
The verifier’s covered-set policy, VerifyOptions::minimum.

Constants§

ALG
The only signature algorithm fiki produces or accepts.
CONTENT_DIGEST
The covered component that binds a body.
DEFAULT_COVERED
@method, @authority, @path, @query — plus content-digest whenever there is a body. This closes the query, host, and body gaps that heti’s KERI dialect leaves open and structurally cannot close. created is a signature parameter rather than a component.
DEFAULT_MINIMUM
What verify_request requires when the caller states no minimum of its own (Minimum::Default, this.i @524c8qgv): fiki’s own signing default, so a verifier left at its defaults accepts what a fiki signer produces and nothing that covers less. A body adds content-digest, and, being a minimum, it requires created and a keyid.
DEFAULT_SKEW
Two hosts disagreeing by a second is ordinary; a verifier that treats it as an attack is unusable.
DERIVED
Derived components fiki builds in a request, and through req from a response.
KERI_VECTORS_FORMAT
The KERI profile’s conformance contract this port satisfies, vectors/keri/’s keri_vectors_format (this.i @8vwrexxc, @4tkkp50h, @5e2phpjy).
KEY_VECTORS_FORMAT
The key-spelling vectors’ conformance contract this port satisfies, vectors/keys/’s key_vectors_format (this.i @0mvgkwnl).
MAX_DICTIONARY_MEMBERS
The most members fiki reads in any of those three dictionaries.
MAX_FIELD_BYTES
The most bytes fiki reads of any untrusted value, measured as received, before it is trimmed or parsed, so size is checked before shape (this.i @5zrf8gjk, @524c8qgv): the Signature, Signature-Input and Content-Digest headers, a target URL, a Host that supplies @authority, and every covered field value. Inclusive, and far above anything an honest sender needs.
MAX_INNER_LIST_ITEMS
The most items fiki reads in any inner list of those three headers, such as a covered list.
MAX_PARAMETERS
The most parameters fiki reads on any item or inner list of those three headers.
REQUEST_MINIMUM
The KERI profile’s minimum covered set for a request (its section 3), for VerifyOptions::minimum and SignOptions::minimum. A body adds content-digest on top.
RESPONSE_DERIVED
The one derived component a response has of its own (RFC 9421 section 2.2.9). Every request component reaches a response only through req.
RESPONSE_MINIMUM
The KERI profile’s minimum covered set for a response. A body adds content-digest, and a response to a request whose content was non-empty adds "content-digest";req.
VECTORS_FORMAT
The conformance contract this port satisfies (this.i @4fhrre0m).

Functions§

aid_from
The canonical AID of the Ed25519 public key text spells (this.i @0mvgkwnl).
content_digest
The RFC 9530 Content-Digest header value for a body.
req
The spelling of a request component named from a response: req("@path") is "@path";req.
response_signature_base
Build the RFC 9421 signature base for a response (sections 2.2.9 and 2.4).
sign_request
Sign a request and return the headers to add to it.
sign_response
Sign a response to request and return the headers to add to it (RFC 9421 section 2.4).
signature_base
Build the RFC 9421 signature base for a request.
to_aid
Render a raw 32-byte Ed25519 public key as a non-transferable AID.
verify_request
Verify a signed request, in the KERI profile’s section 9 order so a message has exactly one correct refusal.
verify_response
Verify a signed response to request, whose req components are read from it.
verifying_key
Recover the Ed25519 public key from a non-transferable AID.

Type Aliases§

Resolver
Maps a keyid to the 32 raw bytes of the Ed25519 key it names, or None when it names no key the caller knows (this.i @6g9zjsv9, @5e2phpjy).
Result
The result of anything fiki can refuse.