• R/O
  • HTTP
  • SSH
  • HTTPS

Bytom-JS-SDK: Commit

It is a project for Bytom Chrome extension JS SDK https://bytom.github.io/Bytom-JS-SDK


Commit MetaInfo

Revision1f9f7d3b736a409c52fe5ecce2841df02c4ad6d9 (tree)
Zeit2020-09-03 11:01:10
AutorZhiting Lin <zlin035@uott...>
CommiterZhiting Lin

Log Message

update the method for verify password

Ändern Zusammenfassung

Diff

--- a/src/sdk/keys.js
+++ b/src/sdk/keys.js
@@ -252,6 +252,21 @@ keysSDK.prototype.isValidMnemonic = function(mnemonic) {
252252
253253 /**
254254 * 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.
255270 *
256271 * @param {String} alias - User specified, unique identifier.
257272 * @param {String} password - User specified, key password.
Show on old repository browser