hm-crypto-nodejs
Advanced tools
Comparing version 1.0.0 to 1.0.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const crypto_1 = require("crypto"); | ||
class HmCrypto { | ||
constructor(digestType, privateKey, publicKey) { | ||
var crypto_1 = require("crypto"); | ||
var HmCrypto = /** @class */ (function () { | ||
function HmCrypto(digestType, privateKey, publicKey) { | ||
this.defaultDigestType = digestType; | ||
@@ -10,14 +10,15 @@ this.defaultPrivateKey = privateKey; | ||
} | ||
sign(message, digestType, privateKey) { | ||
HmCrypto.prototype.sign = function (message, digestType, privateKey) { | ||
digestType = digestType || this.defaultDigestType; | ||
privateKey = privateKey || this.defaultPrivateKey; | ||
return crypto_1.createSign(digestType).update(message).sign(privateKey, "base64"); | ||
} | ||
isValid(message, signature, digestType, publicKey) { | ||
}; | ||
HmCrypto.prototype.isValid = function (message, signature, digestType, publicKey) { | ||
digestType = digestType || this.defaultDigestType; | ||
publicKey = publicKey || this.defaultPublicKey; | ||
return crypto_1.createVerify(digestType).update(message).verify(publicKey, signature, 'base64'); | ||
} | ||
} | ||
}; | ||
return HmCrypto; | ||
}()); | ||
exports.HmCrypto = HmCrypto; | ||
//# sourceMappingURL=hm-crypto.js.map |
{ | ||
"name": "hm-crypto-nodejs", | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"description": "Node.js library for signing and validating requests", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,3 @@ { | ||
"sourceMap": true, | ||
"target": "es6" | ||
"target": "es5" | ||
}, | ||
@@ -10,0 +10,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
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
10778
18
100