pub struct DidDocument {
pub id: String,
pub verification_methods: Vec<VerificationMethod>,
pub assertion_method: Vec<AssertionMethodRef>,
pub services: Vec<Value>,
}Expand description
A minimal DID document (subset sufficient for ACDP §5.11).
Fields§
§id: String§verification_methods: Vec<VerificationMethod>§assertion_method: Vec<AssertionMethodRef>§services: Vec<Value>The service entries, kept as JSON. ACDP reads one service type,
RFC-ACDP-0021’s AcdpKeylessSigning (see
acdp_types::keyless::ListedIdentities).
Implementations§
Source§impl DidDocument
impl DidDocument
Sourcepub fn find_by_fragment(&self, fragment: &str) -> Option<&VerificationMethod>
pub fn find_by_fragment(&self, fragment: &str) -> Option<&VerificationMethod>
Find a verification method whose #fragment is exactly fragment.
Compares the fragment for equality rather than ends_with: a
loose suffix match would let an unlisted …#evil-key-1 satisfy a
lookup for key-1 (authorization-scope escalation within a DID).
A fragment under KEYLESS_FRAGMENT_PREFIX never resolves, even
when the document lists a method for it (RFC-ACDP-0021 §4.2):
keyless key ids are resolved through their key attestation, never
through RFC-ACDP-0001 §5.11, so a pre-listed method cannot make a
verifier accept what a keyless-aware verifier would refuse.
Sourcepub fn is_assertion_method(&self, vm_id: &str) -> bool
pub fn is_assertion_method(&self, vm_id: &str) -> bool
Returns true if vm_id is listed in assertionMethod.
Both vm_id and each assertionMethod entry are normalized to
absolute DID URLs and compared for exact equality. The prior
vm_id.ends_with(id) form authorized any …#evil-key-1 against a
relative #key-1 entry.