From: Zhiting Lin Date: Thu, 3 Sep 2020 02:01:10 +0000 (+0800) Subject: update the method for verify password X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1f9f7d3b736a409c52fe5ecce2841df02c4ad6d9;hp=7214ee723f199a06439648923925b8d40d9215a9;p=bytom%2FBytom-JS-SDK.git update the method for verify password --- diff --git a/src/sdk/keys.js b/src/sdk/keys.js index ed71fa2..576a722 100644 --- a/src/sdk/keys.js +++ b/src/sdk/keys.js @@ -252,6 +252,21 @@ keysSDK.prototype.isValidMnemonic = function(mnemonic) { /** * Create a new key. + * + * @param {String} alias - User specified, unique identifier. + * @param {String} password - User specified, key password. + */ +keysSDK.prototype.verifyPassword = function(keystore, password) { + try{ + decryptKey(keystore, password); + }catch (e){ + return false; + } + return true; +}; + +/** + * Create a new key. * * @param {String} alias - User specified, unique identifier. * @param {String} password - User specified, key password.