Expand description
Portable objects (FEP-ef61): verifying them, and signing them.
A portable object is authentic when an FEP-8b32 integrity proof on it was
made with a key under the DID of its id, and by nothing else: not where
it was fetched from, and not the HTTP signature it arrived under.
docs/guide/portable.md explains it.
did:key is resolved here, since the DID is the key. Any other method
needs a DidResolver from the application.
Structs§
- ApUri
- A portable object’s identifier.
- Ed25519
Signer - An Ed25519 key held in memory, signing as its
did:key. - Hashlink
- A SHA-256 digest as a hashlink names it and
digestMultibasewrites it: a multihash, in base58btc. - Media
- A resource a portable object refers to, as a gateway serves it.
Enums§
- Portable
Error - Why a portable document is not authentic.
Constants§
- GATEWAY_
PATH - The well-known path a gateway serves portable objects under.
- MAX_
GATEWAYS - The most gateways asked for one object, or tried for one delivery. The
hints in an
apURI are its writer’s to choose, and so are an actor’s gateways: unbounded, one reference could send a server to any number of hosts of someone else’s choosing.
Traits§
- DidResolver
- Resolves the DID URLs of methods other than
did:keyto keys. - Proof
Signer - Where a proof comes from: a key the server holds, or one it reaches through a signing service or the user’s device. What is signed is a whole document, and what comes back is that document with its proof.
Functions§
- did_of
- The DID a DID URL is under:
did:method:id, without path, query or fragment.Nonewhen it is not a DID URL. - gateways
- The gateways an actor document lists, in order, as origins: without the
/of an empty path, which some gateways refuse. What is not a gateway is left out;verifyrefuses an actor that lists one. - is_
gateway - Whether
gatewayis what FEP-ef61 allows as one: anhttporhttpsURI with a host and no path, query or fragment,https://server.example, or with the one/of an empty path. - is_
portable - Whether
iri, in any spelling, identifies a portable object. - resolve
- The key
did_urlnames: adid:key’s own, or whatresolversays. - same_
object - Whether two identifiers name the same portable object, however each is spelled.
- verify
- Verify a portable document: its
idis anapURI, a proof by theid’s DID verifies, and an actor lists at least one gateway and nothing else. Returns theid. - verify_
by - Verify that
documentcarries a proof made with a key underdid: any of its proofs, tried in order.
Type Aliases§
- Error
- An error from the application’s resolver or signer.