public static void convertToPemWithoutFiles(Properties sslProps) throws Exception {
        String tsPath = sslProps.getProperty(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG);
        if (tsPath != null) {
            Password trustCerts = exportCertificates(tsPath,
                    (Password) sslProps.get(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG),
                    sslProps.getProperty(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG));
            sslProps.remove(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG);
            sslProps.remove(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG);
            sslProps.setProperty(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, PEM_TYPE);
            sslProps.put(SslConfigs.SSL_TRUSTSTORE_CERTIFICATES_CONFIG, trustCerts);
        }
        String ksPath = sslProps.getProperty(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG);
        if (ksPath != null) {
            String ksType = sslProps.getProperty(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG);
            Password ksPassword = (Password) sslProps.get(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG);
            Password keyPassword = (Password) sslProps.get(SslConfigs.SSL_KEY_PASSWORD_CONFIG);
            Password certChain = exportCertificates(ksPath, ksPassword, ksType);
            Password key = exportPrivateKey(ksPath, ksPassword, keyPassword, ksType, keyPassword);
            sslProps.remove(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG);
            sslProps.remove(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG);
            sslProps.setProperty(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, PEM_TYPE);
            sslProps.put(SslConfigs.SSL_KEYSTORE_CERTIFICATE_CHAIN_CONFIG, certChain);
            sslProps.put(SslConfigs.SSL_KEYSTORE_KEY_CONFIG, key);
        }
    }
Creates a keystore with a single key and saves it to a file.

@param filename String file to save
@param password String store password to set on keystore
@param keyPassword String key password to set on key
@param alias String alias to use for the key
@param privateKey Key to save in keystore
@param cert Certificate to use as certificate chain associated to key
@throws GeneralSecurityException for any error with the security APIs
@throws IOException if there is an I/O error saving the file
clients/src/test/java/org/apache/kafka/test/TestSslUtils.java