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

Method hasPrivateKey

src/modules/KeyringBase.js:49–54  ·  view source on GitHub ↗

* Check if keyring has any private key or specific private keys by keyId * @param {Array } keyIds or fingerprints * @return {Boolean}

(keyIds)

Source from the content-addressed store, hash-verified

47 * @return {Boolean}
48 */
49 hasPrivateKey(keyIds) {
50 if (!keyIds) {
51 return Boolean(this.keystore.privateKeys.keys.length);
52 }
53 return keyIds.some(keyId => this.keystore.privateKeys.getForId(typeof keyId === 'string' ? keyId : keyId.toHex(), true));
54 }
55
56 async getValidSigningKeys() {
57 let signingKeys = await filterAsync(this.keystore.privateKeys.keys, key => this.validateDefaultKey(key));

Callers 2

getKeyringWithPrivKeyFunction · 0.45
hasUsablePrivateKeyFunction · 0.45

Calls 2

getForIdMethod · 0.80
toHexMethod · 0.80

Tested by

no test coverage detected