This is an Alpha release of this package, it is only intended to be used by @inrupt/solid-client-access-grants for now.

@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.

Parameters#

Name

Type

Description

vc

string | URL | DatasetWithId | VerifiableCredentialBase

The VC to verify

options?

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

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.

Since

0.3.0

Defined in#

src/verify/verify.ts:91


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.

Parameters#

Name

Type

Description

verificationEndpoint

null | string

The verification endpoint

verifiablePresentation

VerifiablePresentation | ParsedVerifiablePresentation | MinimalPresentation

The VP to verify

options

Partial<{ challenge: string ; domain: string ; fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>(input: string | Request | 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.

Since

Defined in#

src/verify/verify.ts:192