/** * @module verify */ import type { UrlString } from "@inrupt/solid-client"; import type { DatasetWithId, VerifiableCredentialBase, VerifiablePresentation } from "../common/common"; import type { MinimalPresentation, ParsedVerifiablePresentation } from "../lookup/query"; import type { ParseOptions } from "../parser/jsonld"; /** * Verify that a VC is valid, i.e. : * - its signature matches its issuer's key * - it has not been revoked * - it isn't expired * These verifications are done server-side by a Verification Service, either * discovered from the VC Issuer or manually provided. * * @param vc The VC to verify * @param options Additional options * - `options.fetch`: An alternative `fetch` function to make the HTTP request, * compatible with the browser-native [fetch API](https://developer.mozilla.org/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters). * This can be typically used for authentication. * - `options.verificationEndpoint`: Pass a trusted VC verification service * * @returns a JSON-shaped validation report structured accoring to the [VC Verifier API](https://w3c-ccg.github.io/vc-api/verifier.html#operation/verifyCredential). * @since 0.3.0 */ export declare function isValidVc(vc: VerifiableCredentialBase | DatasetWithId | URL | UrlString, options?: Partial<{ fetch?: typeof fetch; verificationEndpoint?: UrlString; }> & ParseOptions): Promise<{ checks: string[]; warnings: string[]; errors: string[]; }>; /** * Verify that a VP is valid and content has not ben tampered with. * * @param verificationEndpoint The verification endpoint * @param verifiablePresentation The VP to verify * @param options Additional options * - `options.fetch`: An alternative `fetch` function to make the HTTP request, * compatible with the browser-native [fetch API](https://developer.mozilla.org/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters). * This can be typically used for authentication. * - `options.domain`: Pass a domain * - `options.challenge`: Pass a challenge * * @returns a JSON-shaped validation report structured accoring to the [VP Verifier API](https://w3c-ccg.github.io/vc-api/verifier.html#operation/verifyPresentation). * @since 0.6.0 */ export declare function isValidVerifiablePresentation(verificationEndpoint: string | null, verifiablePresentation: VerifiablePresentation | MinimalPresentation | ParsedVerifiablePresentation, options?: Partial<{ fetch: typeof fetch; domain: string; challenge: string; }>): Promise<{ checks: string[]; warnings: string[]; errors: string[]; }>;