Cryptographic Key Pair (@digitalcredentials/keypair)
Table of Contents
Extracted from Digital Bazaar's
library, and converted to Typescript.
This is an abstract key pair data model, meant to be used in individual subclass key pair implementations, such as:
Choosing a Key Type
For digital signatures using the
signing of Verifiable Credentials using
authorization capabilities, and DIDAuth operations:
- Prefer Ed25519VerificationKey2020 type keys, by default.
- Use EcdsaSepc256k1 keys if your use case requires it (for example, if you're developing for a Bitcoin-based or Ethereum-based ledger), or if you require Hierarchical Deterministic (HD) wallet functionality.
For key agreement protocols for encryption operations:
- Use Curve25519 with the
As with most security- and cryptography-related tools, the overall security of your system will largely depend on your design decisions.
- Node.js 16+ is recommended.
To install via NPM:
npm install @digitalcredentials/keypair
To install locally (for development):
git clone https://github.com/digitalcredentials/keypair.git cd keypair npm install
This library is meant to be used only by implementers of new cryptographic key suite libraries.
When adding support for a new suite type subclass of
should do the following:
- Create their own npm package / github repo, such as
- Subclass KeyPair.
- Override relevant methods (such as
- Add to the key type table in the
If editing the Readme, please conform to the standard-readme specification.
MIT License © 2022 Digital Credentials Consortium.