From b746b354c8bd332ff5b1f30c6fe448e05c2efa34 Mon Sep 17 00:00:00 2001 From: "Alexander.Trofimov" Date: Tue, 10 Sep 2019 16:19:57 +0300 Subject: [PATCH] [license] Key Move public key to licenseKey.pem --- Common/sources/license.js | 3 +-- Common/sources/licenseKey.pem | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 Common/sources/licenseKey.pem diff --git a/Common/sources/license.js b/Common/sources/license.js index 30a967a3..56abb216 100644 --- a/Common/sources/license.js +++ b/Common/sources/license.js @@ -80,8 +80,7 @@ exports.readLicense = function*() { const verify = crypto.createVerify('RSA-SHA1'); verify.update(JSON.stringify(oLicense)); - const publicKey = '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRhGF7X4A0ZVlEg594WmODVVUI\niiPQs04aLmvfg8SborHss5gQXu0aIdUT6nb5rTh5hD2yfpF2WIW6M8z0WxRhwicg\nXwi80H1aLPf6lEPPLvN29EhQNjBpkFkAJUbS8uuhJEeKw0cE49g80eBBF4BCqSL6\nPFQbP9/rByxdxEoAIQIDAQAB\n-----END PUBLIC KEY-----\n'; - if (verify.verify(publicKey, sign, 'hex')) { + if (verify.verify(fs.readFileSync('./../../Common/sources/licenseKey.pem'), sign, 'hex')) { const endDate = new Date(oLicense['end_date']); res.endDate = endDate; const isTrial = (true === oLicense['trial'] || 'true' === oLicense['trial']); // Someone who likes to put json string instead of bool diff --git a/Common/sources/licenseKey.pem b/Common/sources/licenseKey.pem new file mode 100644 index 00000000..346a8e6b --- /dev/null +++ b/Common/sources/licenseKey.pem @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRhGF7X4A0ZVlEg594WmODVVUI +iiPQs04aLmvfg8SborHss5gQXu0aIdUT6nb5rTh5hD2yfpF2WIW6M8z0WxRhwicg +Xwi80H1aLPf6lEPPLvN29EhQNjBpkFkAJUbS8uuhJEeKw0cE49g80eBBF4BCqSL6 +PFQbP9/rByxdxEoAIQIDAQAB +-----END PUBLIC KEY-----