MCPcopy
hub / github.com/mailvelope/mailvelope / removeKey

Method removeKey

src/modules/KeyringLocal.js:202–214  ·  view source on GitHub ↗
(fingerprint, type)

Source from the content-addressed store, hash-verified

200 }
201
202 async removeKey(fingerprint, type) {
203 const removedKey = super.removeKey(fingerprint, type);
204 if (type === 'private') {
205 const defaultKeyFpr = await this.keystore.getDefaultKeyFpr();
206 // Remove the key from the keyring attributes if default
207 if (defaultKeyFpr === removedKey.getFingerprint()) {
208 await this.setDefaultKey('');
209 }
210 }
211 await this.sync.add(removedKey.getFingerprint(), keyringSync.DELETE);
212 await this.keystore.store();
213 await this.sync.commit();
214 }
215
216 async revokeKey(unlockedKey) {
217 const {privateKey: revokedKey} = await revokeKey({key: unlockedKey, format: 'object'});

Callers 3

removeUserMethod · 0.95
updateKeyMethod · 0.45
setKeyPwdMethod · 0.45

Calls 5

addMethod · 0.80
commitMethod · 0.80
getDefaultKeyFprMethod · 0.45
setDefaultKeyMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected