The XID.
The XID's reference.
No keys, delegates, services, resolution methods, provenance, attachments, edges or extra assertions.
Assertions the parser did not recognise, kept as they were (a copy).
The resolution methods (a copy).
The keys (a copied-out array of live keys).
The key whose signing key the XID derives from.
The inception key's private keys, when held in the clear.
The inception key's signing key.
The inception key's signing key, else the first key's.
The inception key's encapsulation key, else the first key's.
The delegates (a copied-out array of live delegates).
The services (a copied-out array of live services).
The attachments: the document's own container.
Whether there are attachments.
The current provenance mark.
The generator when the document holds it in the clear.
StaticcodecThe tagged-CBOR codec: decode is fromCbor, the tag required.
StaticfromA document whose XID derives from the inception key's signing key;
the key is added allowed All. A genesis mark starts the provenance
chain and keeps the generator in the document. A missing inception
key or a malformed genesis is a TypeError; a seed of the wrong
length is ProvenanceMark.
StaticrandomA document with a random private key base as its inception key.
StaticfromAdds a resolution method, as a URI or its text (a components error for text that is not a URI).
Removes and returns a resolution method; undefined when it was not there.
Removes and returns the key; StillReferenced when a service names
it, NotFound when it is not there.
Removes and returns the key without checking services; undefined when absent.
KeyNotFoundInDocument unless the key with these public keys is there.
Whether the XID derives from this signing key.
Removes and returns the inception key, if there is one.
Sets the key's nickname; NotFound unless the key is there.
The private keys of a key as an envelope (see Key.privateKeyEnvelope).
StaticextractThe inception key's private keys of a parsed envelope, unlocked with the password.
Adds a delegate; Duplicate when a delegate with that XID is already there.
The delegate whose XID has this reference.
Removes and returns the delegate; StillReferenced when a service names it, NotFound when absent.
Removes and returns the delegate without checking services; undefined when absent.
DelegateNotFoundInDocument unless the delegate with this XID is there.
Adds a service; Duplicate when a service at that URI is already there.
Removes and returns the service; undefined when absent.
Every service references known keys and delegates and allows something.
NoReferences without any key or delegate reference,
UnknownKeyReference/UnknownDelegateReference for one the document
lacks, NoPermissions without an allowed privilege.
Whether any service references this key.
Whether any service references this delegate.
The attachment with this digest.
Removes and returns the attachment with this digest.
Removes every attachment.
The edges: the document's own container (envelope's Edgeable).
The same container as edges() (envelope's Edgeable names both).
Whether there are edges (envelope's Edgeable).
Adds an edge envelope.
The edge with this digest (envelope's Edgeable).
Removes and returns the edge with this digest.
Removes every edge.
Sets (or clears) the mark, dropping any generator.
Sets the mark and the generator that continues its chain.
Advances the chain with the document's own generator, unlocked with
the password when it is locked; the generator stays in the document.
NoProvenanceMark without a mark, NoGenerator without a generator,
InvalidPassword when it is locked and the password is missing or
wrong, ChainIdMismatch/SequenceMismatch when the generator does
not continue the mark at the next sequence number; a Date without a
time is ProvenanceMark[InvalidDate]; a date of another kind is a
TypeError.
Advances the chain with a generator the caller keeps; the generator
is advanced in place and not stored. NoProvenanceMark without a
mark, GeneratorConflict when the document holds a generator (in the
clear or locked), ChainIdMismatch/SequenceMismatch when the
generator does not continue the mark at the next sequence number; a
Date without a time is ProvenanceMark[InvalidDate]; a generator or
date of another kind is a TypeError.
The XID as the subject; 'dereferenceVia', 'key', 'delegate',
'service', 'provenance', the extra assertions, attachments and
edges; then signed per sign (MissingInceptionKey when the
inception key or its private keys are missing). An unknown option
is a TypeError.
toEnvelope signed by signer, the generator omitted.
StaticfromA document from its envelope. With verify: "inception" the envelope
must be signed by the document's own inception key
(EnvelopeNotSigned, SignatureVerificationFailed, InvalidXid);
otherwise a wrapped (signed) subject is unwrapped and read as it is.
The password unlocks locked private keys and generators. Every
failure is an XIDError: a sibling error inside the parser is
wrapped with the reference's code. An unknown verify is a
TypeError.
An empty document is its XID's bytes; otherwise the envelope's tagged CBOR.
Tag xid (40024) over untaggedCbor.
The tags this document's CBOR carries: xid (40024).
StaticfromA document from its tagged CBOR: the xid tag (40024) over the
untagged form. A missing or different tag, or a form the untagged
decoder rejects, is Cbor with the dcbor error's message.
StaticfromA document from its untagged CBOR: a 32-byte string is the XID of an
empty document; anything else is a document envelope. A tagged value
is rejected (the envelope tag is expected), as the reference's
from_untagged_cbor rejects it. A rejection is Cbor: the dcbor
error's message, or the document error's (envelope parsing error,
…) when the envelope decodes but the document does not.
ur:xid/… over untaggedCbor.
StaticfromA document from a ur:xid/… UR. A UR of another type is Cbor
(expected UR type xid, but found …), as the reference's from_ur
reports it.
Same XID, resolution methods, keys (public and private material, nickname, endpoints, permissions), delegates, services, provenance (mark and generator), attachments, edges and extra assertions — as the reference's equality.
A deep copy.
XIDDocument(<short XID>).
A XID document: the keys, delegates, services, resolution methods, provenance, attachments and edges published under an extensible identifier. The document is mutable; its
keys,delegatesandservicesare copied-out arrays of live values, andattachmentsandedges()are the document's own containers.