/** * Saves the generated certificate and private key as a file, using the specified password to protect the key store. * * @param keyStoreType the KeyStore type, such as PKCS12 or JKS * @param file file to export the root certificate and private key to * @param privateKeyAlias alias for the private key in the KeyStore * @param password password for the private key and the KeyStore */ public void saveRootCertificateAndKey(String keyStoreType, File file, String privateKeyAlias, String password) { CertificateAndKey certificateAndKey = generatedCertificateAndKey.get(); KeyStore keyStore = securityProviderTool.createRootCertificateKeyStore(keyStoreType, certificateAndKey, privateKeyAlias, password); securityProviderTool.saveKeyStore(file, keyStore, password); }
/** * Saves the generated certificate and private key as a file, using the specified password to protect the key store. * * @param keyStoreType the KeyStore type, such as PKCS12 or JKS * @param file file to export the root certificate and private key to * @param privateKeyAlias alias for the private key in the KeyStore * @param password password for the private key and the KeyStore */ public void saveRootCertificateAndKey(String keyStoreType, File file, String privateKeyAlias, String password) { CertificateAndKey certificateAndKey = generatedCertificateAndKey.get(); KeyStore keyStore = securityProviderTool.createRootCertificateKeyStore(keyStoreType, certificateAndKey, privateKeyAlias, password); securityProviderTool.saveKeyStore(file, keyStore, password); }
/** * Saves the generated certificate and private key as a file, using the specified password to protect the key store. * * @param keyStoreType the KeyStore type, such as PKCS12 or JKS * @param file file to export the root certificate and private key to * @param privateKeyAlias alias for the private key in the KeyStore * @param password password for the private key and the KeyStore */ public void saveRootCertificateAndKey(String keyStoreType, File file, String privateKeyAlias, String password) { CertificateAndKey certificateAndKey = generatedCertificateAndKey.get(); KeyStore keyStore = securityProviderTool.createRootCertificateKeyStore(keyStoreType, certificateAndKey, privateKeyAlias, password); securityProviderTool.saveKeyStore(file, keyStore, password); }