Read-only mirror.
@jeswr/solid-vcis developed in the jeswr/solid-sdk monorepo and published here byscripts/mirror-publish.mjssogithub:-pinned installs keep working — do not edit or PR this repo. File issues on the monorepo.
Build, sign, and verify W3C Verifiable Credentials 2.0 as queryable JSON-LD and RDF.
The package includes EdDSA and ECDSA Data Integrity suites over RDFC-1.0, plus a proof-suite seam for other cryptosuites.
Experimental and security-critical. Verification must stay fail-closed and use trusted key resolution.
npm install github:jeswr/solid-vc#mainRequires Node.js 24 or newer.
import {
generateKeyPairForSuite,
issueAgentAuthorization,
verifyCredential,
} from "@jeswr/solid-vc";
const key = await generateKeyPairForSuite(
"https://alice.example/profile/card#me#key-1",
"Ed25519",
);
const credential = await issueAgentAuthorization(
{
principal: "https://alice.example/profile/card#me",
agent: "https://bob.example/agent#card",
action: "http://www.w3.org/ns/auth/acl#Read",
target: "https://alice.example/private/notes/",
policy: "https://alice.example/policies/notes.ttl#policy",
validUntil: "2027-01-01T00:00:00.000Z",
},
key,
);
const result = await verifyCredential(credential, {
resolveKey: (id) => (id === key.verificationMethod ? key.publicKey : undefined),
trustedIssuers: ["https://alice.example/profile/card#me"],
});Check result.verified and result.errors; verification failures are structured and never a
generic boolean with no explanation.
A policy IRI alone does not bind mutable policy content. For authorization that depends on policy
contents, pass policyContent when issuing and presentedResources when verifying.
- Credentials: builders, RDF/JSON-LD serializers, and parsers from the root; presentation types and wrappers are also exported.
- Signing:
DataIntegritySuite,SuiteRegistry,defaultSuiteRegistry,generateKeyPairForSuite. - Verification:
verifyCredential, key resolvers, status resolvers, and structured error codes. - Agent authorization:
issueAgentAuthorization,buildBoundAgentAuthorizationCredential. - Content binding:
digestRdfContent,digestQuads,verifyRelatedResources.
MIT © Jesse Wright