build_zone_did_document

Function build_zone_did_document 

Source
pub fn build_zone_did_document(
    zone_key: &ZoneKey,
    x25519_key: Option<&[u8]>,
    services: Vec<Service>,
) -> DidDocument
Expand description

Build a W3C DID Document for a self-certifying [ZoneKey].

The resulting document:

  • Has id = did:ndn:<base64url(zone-root-name-TLV)> (binary-only encoding)
  • Lists the Ed25519 signing key as authentication, assertionMethod, capabilityInvocation, and capabilityDelegation
  • Optionally lists an X25519 key as keyAgreement
  • Has no controller (the zone controls itself)

Publish this document as a signed Data packet at the zone root name so that NdnDidResolver can fetch and verify it.