* Return first private key that matches keyIds * @param {Array |openpgp.Keyid|String} keyIds - keyIds or fingerprints * @return {openpgp.key.Key|null}
(keyIds)
| 233 | * @return {openpgp.key.Key|null} |
| 234 | */ |
| 235 | getPrivateKeyByIds(keyIds) { |
| 236 | keyIds = toArray(keyIds); |
| 237 | for (const keyId of keyIds) { |
| 238 | const keyIdHex = typeof keyId === 'string' ? keyId : keyId.toHex(); |
| 239 | const key = this.keystore.privateKeys.getForId(keyIdHex, true); |
| 240 | if (key) { |
| 241 | return key; |
| 242 | } |
| 243 | } |
| 244 | return null; |
| 245 | } |
| 246 | |
| 247 | /** |
| 248 | * Get keys by fingerprints |
no test coverage detected