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

Function prepare_attestation

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

Source from the content-addressed store, hash-verified

58/// `public_key`, and return it with the bytes to sign.
59#[wasm_bindgen(js_name = prepareAttestation)]
60pub fn prepare_attestation(document: &str, public_key_bytes: &[u8]) -> Result<Prepared, JsError> {
61 let pk = public_key(public_key_bytes)?;
62 let prepared = proof::prepare_attestation(parse(document)?, &pk);
63 Ok(Prepared {
64 document: prepared.value.to_string(),
65 signing_bytes: prepared.signing_bytes,
66 })
67}
68
69/// Attach the proof for `signature` (64 bytes, over the prepared signing
70/// bytes) and check it verifies. Returns the attested document (JSON).

Calls 2

public_keyFunction · 0.85
parseFunction · 0.70