Class SelfSignedCertificateGenerator

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • generateTemporarySelfSignedCertificate

        @NotNull
        public static ObjectPair<java.io.File,​char[]> generateTemporarySelfSignedCertificate​(@NotNull
                                                                                                   java.lang.String toolName,
                                                                                                   @NotNull
                                                                                                   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 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
                                                         java.lang.String toolName,
                                                         @NotNull
                                                         java.io.File keyStoreFile,
                                                         @NotNull
                                                         java.lang.String keyStorePIN,
                                                         @NotNull
                                                         java.lang.String keyStoreType,
                                                         @NotNull
                                                         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 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.