예제 #1
0
  /**
   * Returns true if the entry identified by the given alias is a <i>key entry</i>, and false
   * otherwise.
   *
   * @return true if the entry identified by the given alias is a <i>key entry</i>, false otherwise.
   */
  public boolean engineIsKeyEntry(String alias) {

    AbstractMap.SimpleEntry<String, Collection<KeyStore>> pair = getKeystoresForReading(alias);

    try {
      String entryAlias = pair.getKey();
      for (KeyStore keystore : pair.getValue()) {
        if (keystore.isKeyEntry(entryAlias)) {
          return true;
        }
      }
    } catch (KeyStoreException e) {
      throw new IllegalStateException(e);
    }

    return false;
  }