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

Function attest_value

atomic-canonical/src/proof.rs:116–120  ·  view source on GitHub ↗

Generic attest over a JSON-LD value — the *one* canonicalization/signing path all typed nodes share. Fills `attributedTo` (from the identity's `did:atomic`) when absent, computes the content hash over `hashing_view`, signs `jcs(signing_view)`, and attaches the proof. Returns the value. It is [`prepare_attestation`] → sign → [`attach_proof`]; a signer that holds its key outside this process uses t

(value: Value, identity: &Identity, keypair: &KeyPair)

Source from the content-addressed store, hash-verified

114/// It is [`prepare_attestation`] → sign → [`attach_proof`]; a signer that
115/// holds its key outside this process uses those two halves directly.
116pub fn attest_value(value: Value, identity: &Identity, keypair: &KeyPair) -> Value {
117 let prepared = prepare_attestation(value, &identity.public_key);
118 let signature = Signer::new(keypair).sign(&prepared.signing_bytes);
119 attach_proof(prepared.value, &identity.public_key, &signature)
120}
121
122/// A value made ready to sign: `attributedTo` and `contentHash` filled in,
123/// and the exact bytes the signature must cover.

Callers 15

attest_reportFunction · 0.85
mintFunction · 0.85
mint_requestFunction · 0.85
mint_revocationFunction · 0.85
attest_provFunction · 0.85
attestFunction · 0.85
attest_memoryFunction · 0.85

Calls 3

prepare_attestationFunction · 0.70
attach_proofFunction · 0.70
signMethod · 0.45