MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / getPreferredKeyringId

Function getPreferredKeyringId

src/modules/keyring.js:638–649  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

636 * @return {String}
637 */
638export async function getPreferredKeyringId() {
639 await keyringInitialized;
640 // return gnupg keyring if available, preferred and has valid private key
641 if (keyringMap.has(GNUPG_KEYRING_ID) && prefs.general.prefer_gnupg) {
642 const gpgKeyring = keyringMap.get(GNUPG_KEYRING_ID);
643 // directly access keystore property to avoid async method
644 if (gpgKeyring.keystore.defaultKeyFpr) {
645 return GNUPG_KEYRING_ID;
646 }
647 }
648 return MAIN_KEYRING_ID;
649}

Callers 4

onFormInitMethod · 0.90
onVerifyInitMethod · 0.90
onEditorOptionsMethod · 0.90
onDecryptMessageInitMethod · 0.90

Calls 2

hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected