Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@digitalbazaar/ed25519-verification-key-2020
Advanced tools
Javascript library for generating and working with Ed25519VerificationKey2020 key pairs, for use with crypto-ld.
Javascript library for generating and working with Ed25519VerificationKey2020 key pairs, for use with crypto-ld.
For use with:
crypto-ld
^4.0.0
.jsonld-signatures
digitalbazaar/jsonld-signatures#v6.x
ed25519-signature-2020
vc-js
digitalbazaar/vc-js#v7.x
See also (related specs):
As with most security- and cryptography-related tools, the overall security of your system will largely depend on your design decisions.
To install locally (for development):
git clone https://github.com/digitalbazaar/ed25519-verification-key-2020.git
cd ed25519-verification-key-2020
npm install
To generate a new public/private key pair:
{string} [controller]
Optional controller URI or DID to initialize the
generated key. (This will also init the key id.){string} [seed]
Optional deterministic seed value from which to generate the
key.import {Ed25519VerificationKey2020} from '@digitalbazaar/ed25519-verification-key-2020';
const edKeyPair = await Ed25519VerificationKey2020.generate();
To create an instance of a public/private key pair from data imported from
storage, use .from()
:
const serializedKeyPair = { ... };
const keyPair = await Ed25519VerificationKey2020.from(serializedKeyPair);
To export just the public key of a pair:
await keyPair.export({publicKey: true});
// ->
{
type: 'Ed25519VerificationKey2020',
id: 'did:example:1234#z6MkszZtxCmA2Ce4vUV132PCuLQmwnaDD5mw2L23fGNnsiX3',
controller: 'did:example:1234',
publicKeyMultibase: 'zEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf'
}
To export the full key pair, including private key (warning: this should be a carefully considered operation, best left to dedicated Key Management Systems):
await keyPair.export({publicKey: true, privateKey: true});
// ->
{
type: 'Ed25519VerificationKey2020',
id: 'did:example:1234#z6MkszZtxCmA2Ce4vUV132PCuLQmwnaDD5mw2L23fGNnsiX3',
controller: 'did:example:1234',
publicKeyMultibase: 'zEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf',
privateKeyMultibase: 'z4E7Q4neNHwv3pXUNzUjzc6TTYspqn9Aw6vakpRKpbVrCzwKWD4hQDHnxuhfrTaMjnR8BTp9NeUvJiwJoSUM6xHAZ'
}
To generate a fingerprint:
keyPair.fingerprint();
// ->
'z6MkszZtxCmA2Ce4vUV132PCuLQmwnaDD5mw2L23fGNnsiX3'
To verify a fingerprint:
const fingerprint = 'z6MkszZtxCmA2Ce4vUV132PCuLQmwnaDD5mw2L23fGNnsiX3';
keyPair.verifyFingerprint({fingerprint});
// ->
{valid: true}
In order to perform a cryptographic signature, you need to create a sign
function, and then invoke it.
const keyPair = Ed25519VerificationKey2020.generate();
const {sign} = keyPair.signer();
const data = Buffer.from('test data to sign', 'utf8');
const signatureValue = await sign({data});
In order to verify a cryptographic signature, you need to create a verify
function, and then invoke it (passing it the data to verify, and the signature).
const keyPair = Ed25519VerificationKey2020.generate();
const {verify} = keyPair.verifier();
const valid = await verify({data, signature});
// true
See the contribute file!
PRs accepted.
If editing the Readme, please conform to the standard-readme specification.
Commercial support for this library is available upon request from Digital Bazaar: support@digitalbazaar.com
New BSD License (3-clause) © 2020 Digital Bazaar
1.0.0 - 2021-02-27
Initial version.
FAQs
Javascript library for generating and working with Ed25519VerificationKey2020 key pairs, for use with crypto-ld.
The npm package @digitalbazaar/ed25519-verification-key-2020 receives a total of 2,614 weekly downloads. As such, @digitalbazaar/ed25519-verification-key-2020 popularity was classified as popular.
We found that @digitalbazaar/ed25519-verification-key-2020 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.