java.lang.Object
org.neo4j.driver.internal.util.CertificateTool
A tool used to save, load certs, etc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
loadX509Cert
(Certificate cert, String certAlias, KeyStore keyStore) Load a certificate to a key store with a namestatic void
loadX509Cert
(X509Certificate[] certificates, KeyStore keyStore) static void
loadX509Cert
(List<File> certFiles, KeyStore keyStore) Load the certificates written in X.509 format in a file to a key store.static void
saveX509Cert
(Certificate[] certs, File certFile) Save a list of certificates into a filestatic void
saveX509Cert
(Certificate cert, File certFile) Save a certificate to a file.
-
Method Details
-
saveX509Cert
public static void saveX509Cert(Certificate cert, File certFile) throws GeneralSecurityException, IOException Save a certificate to a file. Remove all the content in the file if there is any before.- Parameters:
cert
- the certificatecertFile
- the certificate file- Throws:
GeneralSecurityException
IOException
-
saveX509Cert
public static void saveX509Cert(Certificate[] certs, File certFile) throws GeneralSecurityException, IOException Save a list of certificates into a file- Parameters:
certs
- the certificatescertFile
- the certificate file- Throws:
GeneralSecurityException
IOException
-
loadX509Cert
public static void loadX509Cert(List<File> certFiles, KeyStore keyStore) throws GeneralSecurityException, IOException Load the certificates written in X.509 format in a file to a key store.- Parameters:
certFiles
- the certificate fileskeyStore
- the key store- Throws:
GeneralSecurityException
IOException
-
loadX509Cert
public static void loadX509Cert(X509Certificate[] certificates, KeyStore keyStore) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
loadX509Cert
public static void loadX509Cert(Certificate cert, String certAlias, KeyStore keyStore) throws KeyStoreException Load a certificate to a key store with a name- Parameters:
certAlias
- a name to identify different certificatescert
- the certificatekeyStore
- the key store- Throws:
KeyStoreException
-