({keyringId, fingerprint, email})
| 122 | } |
| 123 | |
| 124 | async hasPrivateKey({keyringId, fingerprint, email}) { |
| 125 | const keyring = await keyringById(keyringId); |
| 126 | if (fingerprint && email) { |
| 127 | throw new MvError('Use either fingerprint or email parameter.', 'INVALID_OPTIONS'); |
| 128 | } |
| 129 | if (email) { |
| 130 | const keyMap = await keyring.getKeyByAddress(email, {pub: false, priv: true, sort: true}); |
| 131 | return Boolean(keyMap[email]); |
| 132 | } else if (fingerprint) { |
| 133 | const fpr = fingerprint.toLowerCase().replace(/\s/g, ''); |
| 134 | const key = keyring.keystore.privateKeys.getForId(fpr); |
| 135 | if (!key) { |
| 136 | return false; |
| 137 | } |
| 138 | const status = await verifyPrimaryKey(key); |
| 139 | return status === KEY_STATUS.valid; |
| 140 | } else { |
| 141 | const hasPrivateKey = keyring.hasPrivateKey(); |
| 142 | return hasPrivateKey; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | async openSettings({keyringId = MAIN_KEYRING_ID, options = {}}) { |
| 147 | let fragment; |
nothing calls this directly
no test coverage detected