It is a project for Bytom Chrome extension JS SDK https://bytom.github.io/Bytom-JS-SDK
Revision | 1f9f7d3b736a409c52fe5ecce2841df02c4ad6d9 (tree) |
---|---|
Zeit | 2020-09-03 11:01:10 |
Autor | Zhiting Lin <zlin035@uott...> |
Commiter | Zhiting Lin |
update the method for verify password
@@ -252,6 +252,21 @@ keysSDK.prototype.isValidMnemonic = function(mnemonic) { | ||
252 | 252 | |
253 | 253 | /** |
254 | 254 | * Create a new key. |
255 | + * | |
256 | + * @param {String} alias - User specified, unique identifier. | |
257 | + * @param {String} password - User specified, key password. | |
258 | + */ | |
259 | +keysSDK.prototype.verifyPassword = function(keystore, password) { | |
260 | + try{ | |
261 | + decryptKey(keystore, password); | |
262 | + }catch (e){ | |
263 | + return false; | |
264 | + } | |
265 | + return true; | |
266 | +}; | |
267 | + | |
268 | +/** | |
269 | + * Create a new key. | |
255 | 270 | * |
256 | 271 | * @param {String} alias - User specified, unique identifier. |
257 | 272 | * @param {String} password - User specified, key password. |