pub struct AgentDid(/* private fields */);Available on crate feature
did only.Expand description
A permanent, portable identifier for an A1 agent.
Format: did:a1:{hex-encoded-ed25519-verifying-key}
Every DyoloPassport holder has exactly one DID derived deterministically from their Ed25519 verifying key — no registry, no network call, no external system required for generation or verification.
The DID is compatible with the W3C DID Core specification and can be resolved by any system that holds the public key — including other agents, blockchains, enterprise IAM platforms, and EU eIDAS wallets.
§Example
ⓘ
use a1::{DyoloIdentity, did::AgentDid};
let identity = DyoloIdentity::generate();
let did = AgentDid::from_key(&identity.verifying_key());
println!("{did}"); // did:a1:abc123...
let resolved = did.verifying_key().unwrap();
assert_eq!(resolved.as_bytes(), identity.verifying_key().as_bytes());Implementations§
Source§impl AgentDid
impl AgentDid
Sourcepub fn from_key(vk: &VerifyingKey) -> Self
pub fn from_key(vk: &VerifyingKey) -> Self
Derive a DID from an Ed25519 verifying key.
Sourcepub fn verifying_key(&self) -> Result<VerifyingKey, A1Error>
pub fn verifying_key(&self) -> Result<VerifyingKey, A1Error>
Recover the verifying key encoded in this DID.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentDid
impl<'de> Deserialize<'de> for AgentDid
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 AgentDid
impl StructuralPartialEq for AgentDid
Auto Trait Implementations§
impl Freeze for AgentDid
impl RefUnwindSafe for AgentDid
impl Send for AgentDid
impl Sync for AgentDid
impl Unpin for AgentDid
impl UnsafeUnpin for AgentDid
impl UnwindSafe for AgentDid
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.