UNPKG

@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

45 lines • 2.44 kB
import { W3cDataIntegrityUnsecuredDocument } from "../../w3c-di/W3cDataIntegrityProof.mjs"; import { W3cDataIntegrityProcessingIssue } from "../../w3c-di/W3cDataIntegrityError.mjs"; import "../../w3c-di/internal.mjs"; import { JsonLdModuleConfig } from "../jsonld/JsonLdModuleConfig.mjs"; import { W3cV2CredentialsModuleConfig } from "../W3cV2CredentialsModuleConfig.mjs"; import { AgentContext } from "../../../agent/context/AgentContext.mjs"; import "../../../agent/context/index.mjs"; //#region src/modules/vc/data-integrity/W3cV2DataIntegrityContextValidator.d.ts /** * Output of the VC Data Integrity §4.6 Context Validation algorithm. */ export interface W3cV2DataIntegrityContextValidationResult { validated: boolean; validatedDocument: W3cDataIntegrityUnsecuredDocument | null; warnings: W3cDataIntegrityProcessingIssue[]; errors: W3cDataIntegrityProcessingIssue[]; } /** * Implements the VC Data Integrity §4.6 Context Validation algorithm. * * Algorithm inputs: * - inputDocument: the secured document (after proof verification) * - recompactInvalidContexts: whether to run JSON-LD compaction when §4.6 step 3 trigger conditions are detected * * Recompaction delegates context resolution to the shared * {@link JsonLdModuleConfig}, so a custom `documentLoader` configured on * `JsonLdModule`/`W3cCredentialsModule` is honoured consistently with VC 1.1 * JSON-LD processing. Context hash verification (§2.4) only trusts Credo's * bundled context copies; it does not fetch remote content over the network. */ export declare class W3cV2DataIntegrityContextValidator { private readonly jsonLdModuleConfig; private readonly w3cV2CredentialsModuleConfig; constructor(jsonLdModuleConfig: JsonLdModuleConfig, w3cV2CredentialsModuleConfig: W3cV2CredentialsModuleConfig); validate(agentContext: AgentContext, inputDocument: W3cDataIntegrityUnsecuredDocument): Promise<W3cV2DataIntegrityContextValidationResult>; /** * Verifies a spec-pinned context URI (§2.4). The §2.4 hash-pinning mechanism exists for * processors that don't vendor the canonical contexts and must instead fetch and hash-verify * them over the network; Credo vendors all spec-required contexts, so a bundled copy is * trusted as canonical and no network fetch or hash comparison is performed. */ private verifyContextIsBundled; } //#endregion //# sourceMappingURL=W3cV2DataIntegrityContextValidator.d.mts.map