| 16 | |
| 17 | export default class ApiController extends SubController { |
| 18 | constructor(port) { |
| 19 | super(port); |
| 20 | // register event handlers |
| 21 | this.on('get-keyring', this.getKeyring); |
| 22 | this.on('create-keyring', this.createKeyring); |
| 23 | this.on('query-valid-key', this.queryValidKey); |
| 24 | this.on('export-own-pub-key', this.exportOwnPubKey); |
| 25 | this.on('additional-headers-for-outgoing', this.additionalHeadersForOutgoing); |
| 26 | this.on('import-pub-key', this.importPubKey); |
| 27 | this.on('process-autocrypt-header', this.processAutocryptHeader); |
| 28 | this.on('set-logo', this.setLogo); |
| 29 | this.on('has-private-key', this.hasPrivateKey); |
| 30 | this.on('open-settings', this.openSettings); |
| 31 | } |
| 32 | |
| 33 | async getKeyring({keyringId}) { |
| 34 | const keyring = await keyringById(keyringId); |