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

Function did_for_public_key

atomic-canonical/src/did.rs:33–35  ·  view source on GitHub ↗

Build the `did:atomic:...` identifier for a public key. Both DID renderings are derived in `atomic-identity` — the DID *is* the identity's identifier, so it belongs with the type that owns identity, and having one derivation means a `did:atomic` here can never disagree with an `IdentityId` there.

(public_key: &PublicKey)

Source from the content-addressed store, hash-verified

31/// having one derivation means a `did:atomic` here can never disagree with an
32/// `IdentityId` there.
33pub fn did_for_public_key(public_key: &PublicKey) -> String {
34 IdentityId::from_public_key(public_key).to_did()
35}
36
37/// Build the standard `did:key` identifier for an Ed25519 public key
38/// (multicodec `ed25519-pub` + key bytes, base58btc multibase). Always

Callers 15

did_matches_public_keyFunction · 0.70
prepare_attestationFunction · 0.70
attach_proofFunction · 0.70
resolve_verifierFunction · 0.50
row_forFunction · 0.50
runMethod · 0.50

Calls 1

to_didMethod · 0.80