Socket
Socket
Sign inDemoInstall

@digitalcredentials/keypair

Package Overview
Dependencies
0
Maintainers
7
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @digitalcredentials/keypair

Cryptographic key pair data model in Javascript/Typescript, for Node.js, browsers, and React Native. Useful for Verifiable Credentials, DIDs (Decentralized Identifiers), and other uses of Data Integrity.


Version published
Weekly downloads
1.8K
increased by30.43%
Maintainers
7
Install size
25.6 kB
Created
Weekly downloads
 

Changelog

Source

1.0.5 - 2022-12-22

Changed

  • Adjust export compile target.
  • Re-export GenerateKeyPairOptions

Readme

Source

Cryptographic Key Pair (@digitalcredentials/keypair)

Build status NPM Version

Cryptographic key pair data model in Javascript/Typescript, for Node.js, browsers, and React Native. Useful for Verifiable Credentials, DIDs (Decentralized Identifiers), and other uses of Data Integrity.

Table of Contents

Background

Extracted from Digital Bazaar's crypto-ld 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 linked-data-integrity library, signing of Verifiable Credentials using vc library, 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:

Security

As with most security- and cryptography-related tools, the overall security of your system will largely depend on your design decisions.

Install

  • Node.js 16+ is recommended.

NPM

To install via NPM:

npm install @digitalcredentials/keypair

Development

To install locally (for development):

git clone https://github.com/digitalcredentials/keypair.git
cd keypair
npm install

Usage

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 keypair, developers should do the following:

  1. Create their own npm package / github repo, such as example-key-pair.
  2. Subclass KeyPair.
  3. Override relevant methods (such as export() and fingerprint()).
  4. Add to the key type table in the crypto-suite-manager README.md.

Contribute

PRs accepted.

If editing the Readme, please conform to the standard-readme specification.

License

MIT License © 2022 Digital Credentials Consortium.

Keywords

FAQs

Last updated on 23 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc