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

Valery Kharseko
40 mins ago d361f42f2fccf7b6f4e23691d0a40f17969e2ec1
opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerSync.java
@@ -110,11 +110,9 @@
  private final ObjectClass ocMacKey;
  /**
   * Creates a new instance of this trust store synchronization thread.
   * Initializes the local instance certificate and loads certificates and secret keys from ADS.
   *
   * @throws InitializationException in case an exception occurs during
   * initialization, such as a failure to publish the instance-key-pair
   * public-key-certificate in ADS.
   * @throws InitializationException if the local instance certificate cannot be initialized
   */
  public CryptoManagerSync() throws InitializationException
  {
@@ -126,7 +124,7 @@
        POST_RESPONSE_ADD, POST_RESPONSE_MODIFY, POST_RESPONSE_DELETE),
        true);
    try {
      CryptoManagerImpl.publishInstanceKeyEntryInADS();
      CryptoManagerImpl.getInstanceKeyCertificateFromLocalTruststore();
    }
    catch (CryptoManagerException ex) {
      throw new InitializationException(ex.getMessageObject());
@@ -167,6 +165,25 @@
    DirectoryServer.registerInternalPlugin(this);
  }
  /**
   * Publishes the local instance certificate in ADS if its entry is missing.
   *
   * @param requireReplication whether to wait for an ADS replication domain to be enabled
   * @return true if the entry exists or was created, or false if publication must wait
   * @throws InitializationException if the entry cannot be published
   */
  public static boolean publishInstanceKeyEntryInADS(boolean requireReplication) throws InitializationException
  {
    try
    {
      return CryptoManagerImpl.publishInstanceKeyEntryInADS(requireReplication);
    }
    catch (CryptoManagerException ex)
    {
      throw new InitializationException(ex.getMessageObject(), ex);
    }
  }
  private void searchAdminSuffix()
  {
    SearchRequest request = newSearchRequest(adminSuffixDN, SearchScope.WHOLE_SUBTREE, keySearchFilter);