MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / to_did

Method to_did

atomic-identity/src/identity.rs:108–110  ·  view source on GitHub ↗

The `did:atomic` identifier for this identity. The id is already `blake3(public_key)`, which is exactly what the `did:atomic` method specifies, so the DID is a rendering of the id rather than a second derivation that could drift from it. Note this is a *fingerprint*: the public key cannot be recovered from it. Where a verifier needs the key itself, carry [`PublicKey::to_did_key`] alongside.

(&self)

Source from the content-addressed store, hash-verified

106 /// it. Where a verifier needs the key itself, carry
107 /// [`PublicKey::to_did_key`] alongside.
108 pub fn to_did(&self) -> String {
109 format!("{}{}", DID_ATOMIC_PREFIX, self.to_base32())
110 }
111
112 /// Parse a `did:atomic:` identifier back into an id.
113 pub fn from_did(did: &str) -> Result<Self, IdentityError> {

Callers 6

from_environmentFunction · 0.80
executeMethod · 0.80
bump_epochMethod · 0.80
load_for_delegateFunction · 0.80
did_for_public_keyFunction · 0.80
newMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected