From 4ed62ed003d9e18bc4ff04024f8e294a47395256 Mon Sep 17 00:00:00 2001
From: Yuriy Movchan <Yuriy.Movchan@gmail.com>
Date: Mon, 01 Aug 2022 12:20:50 +0000
Subject: [PATCH] Add BCFKS FIPS key store type support (#247)

---
 opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java
index c021bc9..7872560 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java
@@ -48,7 +48,9 @@
     /** Use an existing PKCS#11 key store. */
     PKCS11,
     /** Use an existing PKCS#12 key store. */
-    PKCS12
+    PKCS12,
+    /** Use an existing BCFKS key store. */
+    BCFKS
   }
 
   private CertificateType certificateType;
@@ -214,6 +216,30 @@
   }
 
   /**
+   * Creates a new instance of a SecurityOptions using a BCFKS Key Store.
+   *
+   * @param keystorePath
+   *          the path of the key store.
+   * @param keystorePwd
+   *          the password of the key store.
+   * @param enableSSL
+   *          whether SSL is enabled or not.
+   * @param enableStartTLS
+   *          whether Start TLS is enabled or not.
+   * @param sslPort
+   *          the value of the LDAPS port.
+   * @param aliasesToUse
+   *          the aliases of the certificates in the keystore to be used.
+   * @return a new instance of a SecurityOptions using a PKCS#12 Key Store.
+   */
+  public static SecurityOptions createBCFKSCertificateOptions( String keystorePath, String keystorePwd,
+          boolean enableSSL, boolean enableStartTLS, int sslPort, Collection<String> aliasesToUse)
+  {
+    return createOptionsForCertificatType(
+            CertificateType.BCFKS, keystorePath, keystorePwd, enableSSL, enableStartTLS, sslPort, aliasesToUse);
+  }
+
+  /**
    * Creates a new instance of a SecurityOptions using the provided type Key
    * Store.
    *

--
Gitblit v1.10.0