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

44 lines • 3.17 kB
import { W3cDataIntegrityProofService } from "../../w3c-di/W3cDataIntegrityProofService.mjs"; import "../../w3c-di/internal.mjs"; import { W3cV2DataIntegrityContextValidator } from "./W3cV2DataIntegrityContextValidator.mjs"; import { ClaimFormat } from "../models/ClaimFormat.mjs"; import { W3cV2VerifyCredentialResult, W3cV2VerifyPresentationResult } from "../models/W3cV2VerifyResult.mjs"; import { W3cV2DiSignCredentialOptions, W3cV2DiSignPresentationOptions, W3cV2DiVerifyCredentialOptions, W3cV2DiVerifyPresentationOptions } from "../W3cV2CredentialServiceOptions.mjs"; import { W3cV2VerifiableCredential } from "../models/credential/W3cV2VerifiableCredential.mjs"; import { W3cV2VerifiablePresentation } from "../models/presentation/W3cV2VerifiablePresentation.mjs"; import { AgentContext } from "../../../agent/context/AgentContext.mjs"; import "../../../agent/context/index.mjs"; //#region src/modules/vc/data-integrity/W3cV2DataIntegrityCredentialService.d.ts export declare class W3cV2DataIntegrityCredentialService { private dataIntegrityProofService; private contextValidator; constructor(dataIntegrityProofService: W3cDataIntegrityProofService, contextValidator: W3cV2DataIntegrityContextValidator); signCredential(agentContext: AgentContext, options: W3cV2DiSignCredentialOptions): Promise<W3cV2VerifiableCredential<ClaimFormat.DiVc>>; verifyCredential(agentContext: AgentContext, options: W3cV2DiVerifyCredentialOptions): Promise<W3cV2VerifyCredentialResult>; signPresentation(agentContext: AgentContext, options: W3cV2DiSignPresentationOptions): Promise<W3cV2VerifiablePresentation<ClaimFormat.DiVp>>; verifyPresentation(agentContext: AgentContext, options: W3cV2DiVerifyPresentationOptions): Promise<W3cV2VerifyPresentationResult>; /** * Checks that a secured document was signed by the identity it names as responsible for it — * the `issuer` of a credential, or the `holder` of a presentation. * * Mirrors the equivalent checks in the JWT and SD-JWT services — though those compare key * fingerprints for the issuer, whereas Data Integrity proofs name a verification method, so the * comparison here is by controller for both roles. It implements the association described in * VC-DATA-INTEGRITY §"Relationship to Verifiable Credentials": that the `controller` of the * proof's verification method matches the identifier used for the `issuer` or `holder`, and that * the verification method is expressed under a verification relationship acceptable for the * proof's purpose. The latter is enforced by dereferencing the key with `purpose`. * * Verifying the proof only establishes that *someone* signed; without this comparison a document * could name one party and be signed by an unrelated one. * * @param expectedSigner the `issuer` or `holder`. `Holder` is optional in * VCDM 2.0 so when undefined there is no claim to contradict, so the validation passes. */ private verifySignerIsExpectedParty; private invalidResult; private invalidValidation; private invalidPresentationResult; } //#endregion //# sourceMappingURL=W3cV2DataIntegrityCredentialService.d.mts.map