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
reqcomponents are read from. - Sign
Options - Everything about a signature beyond the message itself. The same options sign a request or a
response;
bodyis the content of whichever is being signed. - Signature
Params - The RFC 9421 signature parameters a signer sets.
- Verdict
- The outcome of a successful verification. An
Errmeans it did not verify. - Verify
Options - The verifier’s policy and the body it has in hand.
Enums§
- Authorities
- The
@authorityvalues a verifier serves,VerifyOptions::authorities(this.i@524c8qgv). - Expected
Keyid - The keyid a verifier expects,
VerifyOptions::expected_keyid(this.i@524c8qgv). - Kind
- The condition a refusal names. The
Displayspelling 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— pluscontent-digestwhenever there is a body. This closes the query, host, and body gaps that heti’s KERI dialect leaves open and structurally cannot close.createdis a signature parameter rather than a component.- DEFAULT_
MINIMUM - What
verify_requestrequires 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 addscontent-digest, and, being a minimum, it requirescreatedand akeyid. - 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
reqfrom a response. - KERI_
VECTORS_ FORMAT - The KERI profile’s conformance contract this port satisfies,
vectors/keri/’skeri_vectors_format(this.i@8vwrexxc, @4tkkp50h, @5e2phpjy). - KEY_
VECTORS_ FORMAT - The key-spelling vectors’ conformance contract this port satisfies,
vectors/keys/’skey_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::minimumandSignOptions::minimum. A body addscontent-digeston 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
textspells (this.i@0mvgkwnl). - content_
digest - The RFC 9530
Content-Digestheader 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
requestand 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, whosereqcomponents are read from it. - verifying_
key - Recover the Ed25519 public key from a non-transferable AID.