mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
20.42.2016 61b9eb1be03fc03a9f4bb0013a08ff44a1059503
opendj-server-legacy/src/main/java/org/opends/server/extensions/FileBasedTrustManagerProvider.java
@@ -55,9 +55,6 @@
{
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /** The DN of the configuration entry for this trust manager provider. */
  private DN configEntryDN;
@@ -73,8 +70,6 @@
  /** The trust store type to use. */
  private String trustStoreType;
  /**
   * Creates a new instance of this file-based trust manager provider.  The
   * <CODE>initializeTrustManagerProvider</CODE> method must be called on the
@@ -85,9 +80,6 @@
    // No implementation is required.
  }
  /** {@inheritDoc} */
  @Override
  public void initializeTrustManagerProvider(
                   FileBasedTrustManagerProviderCfg configuration)
@@ -99,7 +91,6 @@
    configEntryDN = configuration.dn();
    configuration.addFileBasedChangeListener(this);
    // Get the path to the trust store file.
    trustStoreFile = configuration.getTrustStoreFile();
    File f = getFileForPath(trustStoreFile);
@@ -109,7 +100,6 @@
      throw new InitializationException(message);
    }
    // Get the trust store type.  If none is specified, then use the default
    // type.
    trustStoreType = configuration.getTrustStoreType();
@@ -131,7 +121,6 @@
      throw new InitializationException(message);
    }
    // Get the PIN needed to access the contents of the trust store file.  We
    // will offer several places to look for the PIN, and we will do so in the
    // following order:
@@ -231,18 +220,12 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void finalizeTrustManagerProvider()
  {
    currentConfig.removeFileBasedChangeListener(this);
  }
  /** {@inheritDoc} */
  @Override
  public TrustManager[] getTrustManagers()
         throws DirectoryException
@@ -267,7 +250,6 @@
                                   message, e);
    }
    try
    {
      String trustManagerAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
@@ -294,9 +276,6 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationAcceptable(
                         TrustManagerProviderCfg configuration,
@@ -307,9 +286,7 @@
    return isConfigurationChangeAcceptable(config, unacceptableReasons);
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationChangeAcceptable(
                      FileBasedTrustManagerProviderCfg configuration,
                      List<LocalizableMessage> unacceptableReasons)
@@ -317,7 +294,6 @@
    boolean configAcceptable = true;
    DN cfgEntryDN = configuration.dn();
    // Get the path to the trust store file.
    String newTrustStoreFile = configuration.getTrustStoreFile();
    try
@@ -337,7 +313,6 @@
      configAcceptable = false;
    }
    // Check to see if the trust store type is acceptable.
    String storeType = configuration.getTrustStoreType();
    if (storeType != null)
@@ -356,7 +331,6 @@
      }
    }
    // If there is a PIN property, then make sure the corresponding
    // property is set.
    String pinProp = configuration.getTrustStorePinProperty();
@@ -366,7 +340,6 @@
      configAcceptable = false;
    }
    // If there is a PIN environment variable, then make sure the corresponding
    // environment variable is set.
    String pinEnVar = configuration.getTrustStorePinEnvironmentVariable();
@@ -376,7 +349,6 @@
      configAcceptable = false;
    }
    // If there is a PIN file, then make sure the file exists and is readable.
    String pinFile = configuration.getTrustStorePinFile();
    if (pinFile != null)
@@ -418,17 +390,15 @@
      }
    }
    return configAcceptable;
  }
  /** {@inheritDoc} */
  @Override
  public ConfigChangeResult applyConfigurationChange(
                                 FileBasedTrustManagerProviderCfg configuration)
  {
    final ConfigChangeResult ccr = new ConfigChangeResult();
    // Get the path to the trust store file.
    String newTrustStoreFile = configuration.getTrustStoreFile();
    File f = getFileForPath(newTrustStoreFile);
@@ -458,7 +428,6 @@
      ccr.setResultCode(DirectoryServer.getServerErrorResultCode());
    }
    // Get the PIN needed to access the contents of the trust store file.  We
    // will offer several places to look for the PIN, and we will do so in the
    // following order:
@@ -558,7 +527,6 @@
      }
    }
    if (ccr.getResultCode() == ResultCode.SUCCESS)
    {
      trustStoreFile = newTrustStoreFile;