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

jsonld-signatures

Package Overview
Dependencies
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonld-signatures - npm Package Compare versions

Comparing version 2.2.2 to 2.3.0

5

CHANGELOG.md
# jsonld-signatures ChangeLog
## 2.3.0 - 2018-03-20
### Added
- Add in-browser support for ed25519.
## 2.2.2 - 2018-03-08

@@ -4,0 +9,0 @@

32

dist/node6/lib/suites/Ed25519Signature2018.js

@@ -64,12 +64,13 @@ /**

} else {
throw new Error('Not implemented');
/*
// browser or other environment
const privateKey = forge.pki.privateKeyFromPem(options.privateKeyPem);
const md = forge.md.sha256.create();
// decode private key
const privateKey = forge.util.binary.base58.decode(options.privateKeyBase58);
// build signing input per above comment
md.update(encodedHeader + '.', 'utf8');
md.update(verifyData.data, verifyData.encoding);
const binaryString = privateKey.sign(md);
encodedSignature = util.encodeBase64Url(binaryString, {forge});*/
const buffer = new forge.util.ByteBuffer(encodedHeader + '.', 'utf8');
buffer.putBuffer(new forge.util.ByteBuffer(verifyData.data, verifyData.encoding));
const binaryString = forge.ed25519.sign({
message: buffer,
privateKey
}).toString('binary');
encodedSignature = util.encodeBase64Url(binaryString, { forge });
}

@@ -130,11 +131,12 @@

throw new Error('Not implemented');
/*
// browser or other environment
const publicKey = forge.pki.publicKeyFromPem(publicKeyPem);
const md = forge.md.sha256.create();
const publicKey = forge.util.binary.base58.decode(publicKeyBase58);
// rebuild signing input per JWS spec
md.update(encodedHeader + '.', 'utf8');
md.update(verifyData.data, verifyData.encoding);
return publicKey.verify(md.digest().bytes(), rawSignature);*/
const buffer = new forge.util.ByteBuffer(encodedHeader + '.', 'utf8');
buffer.putBuffer(new forge.util.ByteBuffer(verifyData.data, verifyData.encoding));
return forge.ed25519.verify({
message: buffer,
signature: rawSignature,
publicKey
});
})();

@@ -141,0 +143,0 @@ }

@@ -59,12 +59,15 @@ /**

} else {
throw new Error('Not implemented');
/*
// browser or other environment
const privateKey = forge.pki.privateKeyFromPem(options.privateKeyPem);
const md = forge.md.sha256.create();
// decode private key
const privateKey = forge.util.binary.base58.decode(
options.privateKeyBase58);
// build signing input per above comment
md.update(encodedHeader + '.', 'utf8');
md.update(verifyData.data, verifyData.encoding);
const binaryString = privateKey.sign(md);
encodedSignature = util.encodeBase64Url(binaryString, {forge});*/
const buffer = new forge.util.ByteBuffer(encodedHeader + '.', 'utf8');
buffer.putBuffer(new forge.util.ByteBuffer(
verifyData.data, verifyData.encoding));
const binaryString = forge.ed25519.sign({
message: buffer,
privateKey
}).toString('binary');
encodedSignature = util.encodeBase64Url(binaryString, {forge});
}

@@ -120,11 +123,13 @@

throw new Error('Not implemented');
/*
// browser or other environment
const publicKey = forge.pki.publicKeyFromPem(publicKeyPem);
const md = forge.md.sha256.create();
const publicKey = forge.util.binary.base58.decode(publicKeyBase58);
// rebuild signing input per JWS spec
md.update(encodedHeader + '.', 'utf8');
md.update(verifyData.data, verifyData.encoding);
return publicKey.verify(md.digest().bytes(), rawSignature);*/
const buffer = new forge.util.ByteBuffer(encodedHeader + '.', 'utf8');
buffer.putBuffer(new forge.util.ByteBuffer(
verifyData.data, verifyData.encoding));
return forge.ed25519.verify({
message: buffer,
signature: rawSignature,
publicKey
});
}

@@ -131,0 +136,0 @@

{
"name": "jsonld-signatures",
"version": "2.2.2",
"version": "2.3.0",
"description": "An implementation of the Linked Data Signatures specifications for JSON-LD in JavaScript.",

@@ -39,3 +39,3 @@ "homepage": "https://github.com/digitalbazaar/jsonld-signatures",

"jsonld": "^1.0.1",
"node-forge": "^0.7.1",
"node-forge": "^0.7.4",
"semver": "^5.5.0"

@@ -42,0 +42,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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