@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
72 lines • 3.83 kB
text/typescript
import { W3cDataIntegrityDomain, W3cDataIntegrityPreviousProofReference, W3cDataIntegrityProofSetSecuredDocument, W3cDataIntegritySingleProofSecuredDocument, W3cDataIntegrityUnsecuredDocument } from "./W3cDataIntegrityProof.mjs";
import { W3cDataIntegrityCreateFailure, W3cDataIntegrityCreateSuccess, W3cDataIntegrityVerifyFailure, W3cDataIntegrityVerifySuccess } from "./W3cDataIntegrityError.mjs";
import { W3cDataIntegrityCryptosuiteRegistry } from "./W3cDataIntegrityCryptosuiteRegistry.mjs";
import { AgentContext } from "../../agent/context/AgentContext.mjs";
import "../../agent/context/index.mjs";
//#region src/modules/w3c-di/W3cDataIntegrityProofService.d.ts
export interface W3cDataIntegrityCreateProofOptions {
unsecuredDocument: W3cDataIntegrityUnsecuredDocument;
verificationMethod: string;
proofPurpose: string;
cryptosuite: string;
created?: string;
expires?: string;
challenge?: string;
domain?: W3cDataIntegrityDomain;
nonce?: string;
previousProof?: W3cDataIntegrityPreviousProofReference;
}
export interface W3cDataIntegrityVerifyProofOptions {
expectedProofPurpose?: string;
domain?: W3cDataIntegrityDomain;
challenge?: string;
}
export interface W3cDataIntegrityVerifyProofDocumentOptions extends W3cDataIntegrityVerifyProofOptions {
mediaType: string;
documentBytes: Uint8Array;
}
export declare class W3cDataIntegrityProofService {
private dataIntegrityCryptosuiteRegistry;
private readonly supportedMediaTypes;
constructor(dataIntegrityCryptosuiteRegistry: W3cDataIntegrityCryptosuiteRegistry);
/**
* Implements VC Data Integrity v1.0 §4.2 "Add Proof" orchestration.
* Delegates cryptographic suite proof creation and enforces postconditions.
*/
createProof(agentContext: AgentContext, options: W3cDataIntegrityCreateProofOptions): Promise<W3cDataIntegrityCreateSuccess | W3cDataIntegrityCreateFailure>;
/**
* Implements VC Data Integrity v1.0 §4.4 "Verify Proof" algorithm.
* Steps 4-8 are enforced through required-member gate, policy checks,
* field-format validation, and cryptosuite verification.
*/
verifyProof(agentContext: AgentContext, securedDocument: W3cDataIntegritySingleProofSecuredDocument, options?: W3cDataIntegrityVerifyProofOptions): Promise<W3cDataIntegrityVerifySuccess | W3cDataIntegrityVerifyFailure>;
/**
* Implements VC Data Integrity v1.0 §4.5 "Verify Proof Sets and Chains" algorithm.
* Performs chain-structure validation, then verifies each proof against
* reconstructed dependency-proof input.
*/
verifyProofSetAndChain(agentContext: AgentContext, securedDocument: W3cDataIntegrityProofSetSecuredDocument, options?: W3cDataIntegrityVerifyProofOptions): Promise<W3cDataIntegrityVerifySuccess | W3cDataIntegrityVerifyFailure>;
/**
* Parses a secured document and dispatches to §4.4 or §4.5 verification paths.
*/
verifyProofDocument(agentContext: AgentContext, options: W3cDataIntegrityVerifyProofDocumentOptions): Promise<W3cDataIntegrityVerifySuccess | W3cDataIntegrityVerifyFailure>;
/**
* Implements VC Data Integrity v1.0 §4.4 steps 5-8 for a single-proof input.
* Runs proof checks, field-format checks, relationship validation, and cryptosuite verification.
*/
private verifySingleProofCore;
/**
* Implements VC Data Integrity v1.0 §4.4 steps 5-7 verification policy checks.
* Validates expected proofPurpose, domain, and challenge when provided.
*/
private validateProofPolicy;
private createProofIdToIndexMap;
private getMatchingProofIndices;
/**
* Implements VC Data Integrity v1.0 §4.5 step 3.3 input reconstruction.
* Adds matching dependency proofs into the unsecured document for per-proof verification.
*/
private reconstructProofInputDocument;
}
//#endregion
//# sourceMappingURL=W3cDataIntegrityProofService.d.mts.map