code: public static File guessKeyRingFile() throws FileNotFoundException {
          final Collection<String> possibleLocations = getKnownPGPSecureRingLocations();
          for (final String location : possibleLocations) {
              final File candidate = new File(location);
              if (candidate.exists()) {
                  return candidate;
              }
          }
          final StringBuilder message = new StringBuilder("Could not locate secure keyring, locations tried: ");
          final Iterator<String> it = possibleLocations.iterator();
          while (it.hasNext()) {
              message.append(it.next());
              if (it.hasNext()) {
                  message.append(", ");
              }
          }
          throw new FileNotFoundException(message.toString());
      }
docs: Tries to guess location of the user secure keyring using various
  heuristics.
  
  @return path to the keyring file
  @throws FileNotFoundException if no keyring file found