pub struct DidDocument {
pub id: String,
pub verification_methods: Vec<VerificationMethod>,
pub assertion_method: Vec<AssertionMethodRef>,
}Expand description
A minimal DID document (subset sufficient for ACDP §5.11).
Fields§
§id: String§verification_methods: Vec<VerificationMethod>§assertion_method: Vec<AssertionMethodRef>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).
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.
Trait Implementations§
Source§impl Clone for DidDocument
impl Clone for DidDocument
Source§fn clone(&self) -> DidDocument
fn clone(&self) -> DidDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DidDocument
impl Debug for DidDocument
Source§impl<'de> Deserialize<'de> for DidDocument
impl<'de> Deserialize<'de> for DidDocument
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DidDocument
impl RefUnwindSafe for DidDocument
impl Send for DidDocument
impl Sync for DidDocument
impl Unpin for DidDocument
impl UnsafeUnpin for DidDocument
impl UnwindSafe for DidDocument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more