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

Function did_matches_public_key

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

Does this DID correspond to the given public key? Accepts either the in-tree `did:atomic` fingerprint or the standard `did:key` form.

(did: &str, public_key: &PublicKey)

Source from the content-addressed store, hash-verified

58/// Does this DID correspond to the given public key? Accepts either the
59/// in-tree `did:atomic` fingerprint or the standard `did:key` form.
60pub fn did_matches_public_key(did: &str, public_key: &PublicKey) -> bool {
61 did == did_for_public_key(public_key) || did == did_key_for_public_key(public_key)
62}
63
64#[cfg(test)]
65mod tests {

Callers 1

verify_valueFunction · 0.85

Calls 2

did_for_public_keyFunction · 0.85
did_key_for_public_keyFunction · 0.85

Tested by

no test coverage detected