A library for verifying Authorization Capability (ZCAP) invocations via HTTP signatures
  • JavaScript 100%
Find a file
Benjamin Goering bdd5c50840
Merge pull request #1 from gobengo/no-rewrite-uri-scheme
verifyCapabilityInvocation no longer silently rewrites the invocationTarget to use a different uri scheme than options.url
2025-10-04 14:32:31 -07:00
.github/workflows Update dev deps and github actions. 2024-04-02 10:53:19 -04:00
lib verifyCapabilityInvocation no longer silently rewrites the invocationTarget to use a different uri scheme than options.url 2025-10-04 14:31:27 -07:00
tests verifyCapabilityInvocation no longer silently rewrites the invocationTarget to use a different uri scheme than options.url 2025-10-04 14:31:27 -07:00
.eslintrc.cjs Use prefer-node-protocol rule. 2022-06-07 22:47:48 -04:00
.gitignore Setup CI and coverage workflow. 2020-04-16 15:48:21 -04:00
CHANGELOG.md Update changelog. 2024-04-02 10:54:06 -04:00
karma.conf.cjs Convert to module (ESM). 2022-06-07 22:47:48 -04:00
LICENSE Update copyright notices. 2021-03-02 14:17:42 -05:00
package.json Start 11.1.2-0. 2024-04-02 10:54:34 -04:00
README.md Use WebCrypto polyfill for testing. 2022-06-07 22:47:48 -04:00

http-signature-zcap-verify (@digitalbazaar/http-signature-zcap-verify)

A library for verifying Authorization Capability (ZCAP) invocations via HTTP signatures

Install

  • Browsers and Node.js 14+ are supported.
  • Web Crypto API required. Older browsers and Node.js 14 must use a polyfill.

To install from NPM:

npm install @digitalbazaar/http-signature-zcap-verify

Example "getVerifier" for "verifyCapabilityInvocation"

import {CryptoLD} from 'crypto-ld';
import {Ed25519VerificationKey2020} from
  '@digitalbazaar/ed25519-verification-key-2020';

const cryptoLd = new CryptoLD();
cryptoLd.use(Ed25519VerificationKey2020);

async function getVerifier({keyId, documentLoader}) {
  const key = await cryptoLd.fromKeyId({id: keyId, documentLoader});
  const verificationMethod = await key.export(
    {publicKey: true, includeContext: true});
  const verifier = key.verifier();
  return {verifier, verificationMethod};
}