Skip to content

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

License

Notifications You must be signed in to change notification settings

dogwoodlogic/http-signature-zcap-verify

 
 

Repository files navigation

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};
}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%