From 75d8c441ca0eefb700fa8a41ee726e56a902d49a Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 20 Oct 2008 11:40:48 +0000
Subject: [PATCH] Fix for issue 3504 (setup --userJavaKeystore doesn't support JCEKS keystore).

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
index a63e652..b60f777 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
@@ -55,6 +55,10 @@
      */
     JKS,
     /**
+     * Use an existing JCEKS keystore.
+     */
+    JCEKS,
+    /**
      * Use an existing PKCS#11 keystore.
      */
     PKCS11,
@@ -130,6 +134,31 @@
   }
 
   /**
+   * Creates a new instance of a SecurityOptions using a JCE 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 aliasToUse the alias of the certificate in the keystore to be used.
+   * @return a new instance of a SecurityOptions using a JCE Key Store.
+   */
+  public static SecurityOptions createJCEKSCertificateOptions(
+      String keystorePath,
+      String keystorePwd, boolean enableSSL, boolean enableStartTLS,
+      int sslPort, String aliasToUse)
+  {
+    SecurityOptions ops = new SecurityOptions();
+    ops.setCertificateType(CertificateType.JCEKS);
+    ops.setKeyStorePath(keystorePath);
+    ops.setKeyStorePassword(keystorePwd);
+    updateCertificateOptions(ops, enableSSL, enableStartTLS, sslPort,
+        aliasToUse);
+    return ops;
+  }
+
+
+  /**
    * Creates a new instance of a SecurityOptions using a PKCS#11 Key Store.
    * @param keystorePwd the password of the key store.
    * @param enableSSL whether SSL is enabled or not.

--
Gitblit v1.10.0