Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crypto-ld

Package Overview
Dependencies
Maintainers
5
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypto-ld - npm Package Compare versions

Comparing version 3.5.3 to 3.6.0

6

CHANGELOG.md
# crypto-ld ChangeLog
## 3.6.0 - 2019-08-06
### Added
- Add `LDKeyPair.fromFingerprint()` to create an Ed25519KeyPair instance
from a fingerprint (for use with `did:key` method code).
## 3.5.3 - 2019-07-16

@@ -4,0 +10,0 @@

@@ -7,2 +7,3 @@ /*!

const forge = require('node-forge');
const {util: {binary: {base58}}} = forge;

@@ -118,3 +119,28 @@ class LDKeyPair {

}
/**
* Creates an instance of LDKeyPair from a key fingerprint.
* Note: Only key types that use their full public key in the fingerprint
* are supported (so, currently, only 'ed25519').
*
* @param {string} fingerprint
* @returns {LDKeyPair}
* @throws Unsupported Fingerprint Type.
*/
static fromFingerprint({fingerprint}) {
// skip leading `z` that indicates base58 encoding
const buffer = base58.decode(fingerprint.substr(1));
// buffer is: 0xed 0x01 <public key bytes>
if(buffer[0] === 0xed && buffer[1] === 0x01) {
const Ed25519KeyPair = require('./Ed25519KeyPair');
return new Ed25519KeyPair({
publicKeyBase58: base58.encode(buffer.slice(2))
});
}
throw new Error(`Unsupported Fingerprint Type: ${fingerprint}`);
}
/**
* Generates a

@@ -121,0 +147,0 @@ * [pdkdf2]{@link https://en.wikipedia.org/wiki/PBKDF2} key.

2

package.json
{
"name": "crypto-ld",
"version": "3.5.3",
"version": "3.6.0",
"description": "A library for managing cryptographic keys using Linked Data.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/digitalbazaar/crypto-ld",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc