Package com.unboundid.ldap.listener
Class SelfSignedCertificateGenerator
- java.lang.Object
-
- com.unboundid.ldap.listener.SelfSignedCertificateGenerator
-
@ThreadSafety(level=NOT_THREADSAFE) public final class SelfSignedCertificateGenerator extends java.lang.Object
This class provides a mechanism for generating a self-signed certificate for use by a listener that supports SSL or StartTLS.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
generateSelfSignedCertificate(java.lang.String toolName, java.io.File keyStoreFile, java.lang.String keyStorePIN, java.lang.String keyStoreType, java.lang.String alias)
Generates a self-signed certificate in the specified keystore.static ObjectPair<java.io.File,char[]>
generateTemporarySelfSignedCertificate(java.lang.String toolName, java.lang.String keyStoreType)
Generates a temporary keystore containing a self-signed certificate for use by a listener that supports SSL or StartTLS.
-
-
-
Method Detail
-
generateTemporarySelfSignedCertificate
public static ObjectPair<java.io.File,char[]> generateTemporarySelfSignedCertificate(java.lang.String toolName, java.lang.String keyStoreType) throws CertException
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 benull
.- 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(java.lang.String toolName, java.io.File keyStoreFile, java.lang.String keyStorePIN, java.lang.String keyStoreType, java.lang.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 benull
, 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 benull
.keyStoreType
- The key store type for the keystore to be created, if it does not already exist. It must not benull
.alias
- The alias to use for the certificate in the keystore. It must not benull
.- Throws:
CertException
- If a problem occurs while trying to generate self-signed certificate.
-
-