@inrupt/solid-client-vc / verify

Module: verify#

Functions#

isValidVc#

isValidVc(vc, options?): Promise<{ checks: string[] ; errors: string[] ; warnings: string[] }>

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.

Since

0.3.0

Parameters#

Name

Type

Description

vc

string | URL | VerifiableCredential

The VC to verify

options

Partial<{ fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> ; verificationEndpoint?: string }>

Additional options - options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This can be typically used for authentication. - options.verificationEndpoint: Pass a trusted VC verification service

Returns#

Promise<{ checks: string[] ; errors: string[] ; warnings: string[] }>

a JSON-shaped validation report structured accoring to the VC Verifier API.

Defined in#

src/verify/verify.ts:86


isValidVerifiablePresentation#

isValidVerifiablePresentation(verificationEndpoint, verifiablePresentation, options?): Promise<{ checks: string[] ; errors: string[] ; warnings: string[] }>

Verify that a VP is valid and content has not ben tampered with.

Since

Parameters#

Name

Type

Description

verificationEndpoint

null | string

The verification endpoint

verifiablePresentation

VerifiablePresentation

The VP to verify

options

Partial<{ challenge: string ; domain: string ; fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

Additional options - options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This can be typically used for authentication. - options.domain: Pass a domain - options.challenge: Pass a challenge

Returns#

Promise<{ checks: string[] ; errors: string[] ; warnings: string[] }>

a JSON-shaped validation report structured accoring to the VP Verifier API.

Defined in#

src/verify/verify.ts:162