pub struct DataIntegrityProof {
pub type_: String,
pub cryptosuite: CryptoSuite,
pub created: Option<String>,
pub verification_method: String,
pub proof_purpose: String,
pub proof_value: Option<String>,
pub context: Option<Vec<String>>,
}Expand description
Serialized Data Integrity proof.
Fields§
§type_: StringMust be ‘DataIntegrityProof’
cryptosuite: CryptoSuite§created: Option<String>§verification_method: String§proof_purpose: String§proof_value: Option<String>§context: Option<Vec<String>>Implementations§
Source§impl DataIntegrityProof
impl DataIntegrityProof
Sourcepub async fn sign_multi<S>(
data_doc: &S,
signers: &[&dyn Signer],
options: SignOptions,
) -> Result<Vec<DataIntegrityProof>, DataIntegrityError>where
S: Serialize,
pub async fn sign_multi<S>(
data_doc: &S,
signers: &[&dyn Signer],
options: SignOptions,
) -> Result<Vec<DataIntegrityProof>, DataIntegrityError>where
S: Serialize,
Signs data_doc with every signer in signers, producing one
DataIntegrityProof per signer.
Fail-fast: if any signer errors, no proofs are emitted and the error is returned immediately.
All signers share the same SignOptions — the per-signer
cryptosuite still defaults via Signer::cryptosuite, so a
heterogeneous list of signers (Ed25519 + ML-DSA-44) produces one
proof per suite automatically.
Source§impl DataIntegrityProof
impl DataIntegrityProof
Sourcepub async fn sign<S>(
data_doc: &S,
signer: &dyn Signer,
options: SignOptions,
) -> Result<DataIntegrityProof, DataIntegrityError>where
S: Serialize,
pub async fn sign<S>(
data_doc: &S,
signer: &dyn Signer,
options: SignOptions,
) -> Result<DataIntegrityProof, DataIntegrityError>where
S: Serialize,
Produces a Data Integrity proof over data_doc.
The cryptosuite is picked from SignOptions::cryptosuite if
set, otherwise from Signer::cryptosuite. Canonicalization
(JCS or RDFC) is derived from the suite.
Sourcepub fn verify_with_public_key<S>(
&self,
data_doc: &S,
public_key_bytes: &[u8],
options: VerifyOptions,
) -> Result<(), DataIntegrityError>where
S: Serialize,
pub fn verify_with_public_key<S>(
&self,
data_doc: &S,
public_key_bytes: &[u8],
options: VerifyOptions,
) -> Result<(), DataIntegrityError>where
S: Serialize,
Verifies a proof against data_doc using caller-provided public
key bytes.
Sync because this is pure CPU — callers who already have the key
should not be forced into an async runtime. See verify for
the resolver-based async variant.
Sourcepub async fn verify<S, R>(
&self,
data_doc: &S,
resolver: &R,
options: VerifyOptions,
) -> Result<(), DataIntegrityError>
pub async fn verify<S, R>( &self, data_doc: &S, resolver: &R, options: VerifyOptions, ) -> Result<(), DataIntegrityError>
Verifies a proof by resolving the public key from its
verificationMethod via a VerificationMethodResolver.
Use did_vm::DidKeyResolver for did:key: URIs (no I/O); plug
in a custom resolver for did:web, did:webvh, or any other
method. The library also checks that the resolved key’s
KeyType matches the proof’s cryptosuite — a cheap guard
against “right proof, wrong key” class bugs.
Async because typical resolvers perform I/O (HTTP, cache lookups, HSM introspection).
Trait Implementations§
Source§impl Clone for DataIntegrityProof
impl Clone for DataIntegrityProof
Source§fn clone(&self) -> DataIntegrityProof
fn clone(&self) -> DataIntegrityProof
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more