hasKey = async (id) => {
    if (!id) {
      throw new Error('id needed to check a key')
    }

    let hasKey = false
    let key = await keyCache.get(id)
    if (key) {
      hasKey = true
    } else {
      try {
        key = await storage.get('private_' + id)
        hasKey = key !== undefined && key !== null
      } catch (e) {
        // Catches 'Error: ENOENT: no such file or directory, open <path>'
        console.error('Error: ENOENT: no such file or directory')
      }
    }

    return hasKey
  }
Checks if a key exists in the key store .
@param {string} id The id of an [Identity]{@link module:Identities~Identity} to check the key for.
@return {boolean} True if the key exists, false otherwise.
@throws id needed to check a key if no id is specified.
@memberof module:KeyStore~KeyStore
@async
@instance