(options)
| 321 | } |
| 322 | |
| 323 | async generateKey(options) { |
| 324 | const newKey = await super.generateKey(options); |
| 325 | if (options.unlocked) { |
| 326 | newKey.privateKey = await decryptKey({privateKey: newKey.privateKey, passphrase: options.passphrase}); |
| 327 | } |
| 328 | await this.sync.add(newKey.privateKey.getFingerprint(), keyringSync.INSERT); |
| 329 | await this.keystore.store(); |
| 330 | await this.sync.commit(); |
| 331 | // if no default key in the keyring set the generated key as default |
| 332 | if (!await this.hasDefaultKey()) { |
| 333 | await this.setDefaultKey(newKey.privateKey.getFingerprint()); |
| 334 | } |
| 335 | return newKey; |
| 336 | } |
| 337 | } |
nothing calls this directly
no test coverage detected