pub struct DidDocument {
pub context: Vec<String>,
pub id: String,
pub verification_method: Vec<VerificationMethod>,
pub authentication: Vec<String>,
pub assertion_method: Vec<String>,
pub capability_delegation: Vec<String>,
pub passport_namespace: Option<String>,
pub capability_mask_hex: Option<String>,
pub a1_version: String,
}Available on crate feature
did only.Expand description
A W3C DID Document for an A1 agent.
Serializes to standard W3C DID JSON-LD, readable by any DID resolver, enterprise identity platform, or EU eIDAS wallet without A1-specific code.
§Example
ⓘ
use a1::{DyoloIdentity, did::DidDocument};
let identity = DyoloIdentity::generate();
let doc = DidDocument::for_identity(&identity.verifying_key());
println!("{}", doc.to_json().unwrap());Fields§
§context: Vec<String>§id: String§verification_method: Vec<VerificationMethod>§authentication: Vec<String>§assertion_method: Vec<String>§capability_delegation: Vec<String>§passport_namespace: Option<String>§capability_mask_hex: Option<String>§a1_version: StringImplementations§
Source§impl DidDocument
impl DidDocument
Sourcepub fn for_identity(vk: &VerifyingKey) -> Self
pub fn for_identity(vk: &VerifyingKey) -> Self
Generate a W3C DID Document for an Ed25519 identity.
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