Class SelfSignedCertificateGenerator

java.lang.Object
com.unboundid.ldap.listener.SelfSignedCertificateGenerator

This class provides a mechanism for generating a self-signed certificate for use by a listener that supports SSL or StartTLS.
  • Method Details

    • generateTemporarySelfSignedCertificate

      Generates a temporary keystore containing a self-signed certificate for use by a listener that supports SSL or StartTLS.
      Parameters:
      toolName - The name of the tool for which the certificate is to be generated.
      keyStoreType - The key store type for the keystore to be created. It must not be null.
      Returns:
      An ObjectPair containing the path and PIN for the keystore that was generated.
      Throws:
      CertException - If a problem occurs while trying to generate the temporary keystore containing the self-signed certificate.
    • generateSelfSignedCertificate

      public static void generateSelfSignedCertificate(@NotNull String toolName, @NotNull File keyStoreFile, @NotNull String keyStorePIN, @NotNull String keyStoreType, @NotNull String alias) throws CertException
      Generates a self-signed certificate in the specified keystore.
      Parameters:
      toolName - The name of the tool for which the certificate is to be generated.
      keyStoreFile - The path to the keystore file in which the certificate is to be generated. This must not be null, and if the target file exists, then it must be a JKS or PKCS #12 keystore. If it does not exist, then at least the parent directory must exist.
      keyStorePIN - The PIN needed to access the keystore. It must not be null.
      keyStoreType - The key store type for the keystore to be created, if it does not already exist. It must not be null.
      alias - The alias to use for the certificate in the keystore. It must not be null.
      Throws:
      CertException - If a problem occurs while trying to generate self-signed certificate.