jsonld-signatures
Advanced tools
Comparing version 1.1.4 to 1.1.5
{ | ||
"name": "jsonld-signatures", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"moduleType": [ | ||
@@ -5,0 +5,0 @@ "amd" |
@@ -805,6 +805,11 @@ /** | ||
return function(input, options, callback) { | ||
var crypto = api.use('crypto'); | ||
var signer = crypto.createSign('RSA-SHA256'); | ||
signer.update(_getDataToHash(input, options), 'utf8'); | ||
var signature = signer.sign(options.privateKeyPem, 'base64'); | ||
var signature; | ||
try { | ||
var crypto = api.use('crypto'); | ||
var signer = crypto.createSign('RSA-SHA256'); | ||
signer.update(_getDataToHash(input, options), 'utf8'); | ||
signature = signer.sign(options.privateKeyPem, 'base64'); | ||
} catch(err) { | ||
return callback(err); | ||
} | ||
callback(null, signature); | ||
@@ -814,7 +819,12 @@ }; | ||
return function(input, options, callback) { | ||
var forge = api.use('forge'); | ||
var privateKey = forge.pki.privateKeyFromPem(options.privateKeyPem); | ||
var md = forge.md.sha256.create(); | ||
md.update(_getDataToHash(input, options), 'utf8'); | ||
var signature = forge.util.encode64(privateKey.sign(md)); | ||
var signature; | ||
try { | ||
var forge = api.use('forge'); | ||
var privateKey = forge.pki.privateKeyFromPem(options.privateKeyPem); | ||
var md = forge.md.sha256.create(); | ||
md.update(_getDataToHash(input, options), 'utf8'); | ||
signature = forge.util.encode64(privateKey.sign(md)); | ||
} catch(err) { | ||
return callback(err); | ||
} | ||
callback(null, signature); | ||
@@ -821,0 +831,0 @@ }; |
{ | ||
"name": "jsonld-signatures", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "An implementation of the Linked Data Signatures specification for JSON-LD in node.js.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/digitalbazaar/jsonld-signatures", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78170
14
1756