pub struct DidDocument {
pub id: Did,
pub verification_method: Vec<VerificationMethod>,
pub authentication: Vec<String>,
pub key_agreement: Vec<String>,
pub service: Vec<DidService>,
}Expand description
Minimal DID document model used by Typesec integrations.
Fields§
§id: DidSubject DID.
verification_method: Vec<VerificationMethod>Verification methods available for this DID.
authentication: Vec<String>Authentication key references.
key_agreement: Vec<String>Key-agreement key references.
service: Vec<DidService>Service endpoints.
Implementations§
Source§impl DidDocument
impl DidDocument
Sourcepub fn single_key(did: Did, public_key: impl AsRef<[u8]>) -> Self
pub fn single_key(did: Did, public_key: impl AsRef<[u8]>) -> Self
Create a document with one key used for authentication and key agreement.
Sourcepub fn with_signing_and_agreement_keys(
did: Did,
signing_public: impl AsRef<[u8]>,
agreement_public: impl AsRef<[u8]>,
) -> Self
pub fn with_signing_and_agreement_keys( did: Did, signing_public: impl AsRef<[u8]>, agreement_public: impl AsRef<[u8]>, ) -> Self
Create a document with separate Ed25519 (authentication) and X25519
(key-agreement) keys, as produced by Ed25519DidKey.
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
impl Eq for DidDocument
Source§impl PartialEq for DidDocument
impl PartialEq for DidDocument
Source§fn eq(&self, other: &DidDocument) -> bool
fn eq(&self, other: &DidDocument) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DidDocument
impl Serialize for DidDocument
impl StructuralPartialEq for DidDocument
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