pub struct DidDocument {
pub id: String,
pub verification_method: Vec<VerificationMethod>,
pub assertion_method: Vec<Value>,
}Expand description
A DID Document, parsed to the fields APH needs.
Deliberately NOT deny_unknown_fields: a DID Document is a general W3C
artifact that legitimately carries much more than APH reads (services,
authentication relationships, other proof purposes). Rejecting those
would make APH unable to verify notaries with ordinary DID Documents.
Fields§
§id: StringThe document’s own DID.
verification_method: Vec<VerificationMethod>Published keys. Absent in a document that delegates all keys by reference, which APH cannot use.
assertion_method: Vec<Value>DID URLs approved for the assertionMethod proof purpose.
Implementations§
Source§impl DidDocument
impl DidDocument
Sourcepub fn allows_assertion(&self, did_url: &str) -> bool
pub fn allows_assertion(&self, did_url: &str) -> bool
Returns true if did_url is listed for the assertionMethod proof
purpose, which is the purpose APH envelope proofs declare.
Entries may be plain DID URL strings or embedded objects with an id;
both forms are recognized.
Sourcepub fn resolve_key(&self, did_url: &str) -> Result<NotaryPublicKey, AphError>
pub fn resolve_key(&self, did_url: &str) -> Result<NotaryPublicKey, AphError>
Finds the key a proof’s verificationMethod names (spec §8.4.4
steps 5–6).
When the DID URL carries no fragment, the document must publish exactly one key: guessing among several would let the document’s ordering decide which key verifies a credential.
Trait Implementations§
Source§impl Clone for DidDocument
impl Clone for DidDocument
Source§fn clone(&self) -> DidDocument
fn clone(&self) -> DidDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more