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

Function verify_attestation

atomic-wasm/src/lib.rs:86–89  ·  view source on GitHub ↗
(document: &str, public_key_bytes: &[u8])

Source from the content-addressed store, hash-verified

84/// Check an attested document (JSON) against a public key.
85#[wasm_bindgen(js_name = verifyAttestation)]
86pub fn verify_attestation(document: &str, public_key_bytes: &[u8]) -> Result<(), JsError> {
87 let pk = public_key(public_key_bytes)?;
88 proof::verify_value(&parse(document)?, &pk).map_err(|e| JsError::new(&e.to_string()))
89}
90
91/// The `did:atomic` identifier for a public key.
92#[wasm_bindgen(js_name = didForPublicKey)]

Callers

nothing calls this directly

Calls 3

public_keyFunction · 0.85
verify_valueFunction · 0.85
parseFunction · 0.70

Tested by

no test coverage detected