Implementation Note
SSL certificates are installed at TrustStoreManager#configureTrustStore(Path)
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| private KeyStore | |
| private static final String | |
| private final Path |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public List | |
| public boolean | |
| public int | |
| public void | clearCustomCertificates()
Deletes all custom certificates, Custom certificates are certificates with alias that ends with |
| private static void | |
| private static X509TrustManager | |
| public static void | createTruststoreFileIfNotExist(Path
path of the truststore storePath)This method checks to see if the truststore is present in |
| public void | |
| private static X509TrustManager | |
| public void | |
| public X509Certificate | |
| public List | |
| private static X509TrustManager | |
| private static X509TrustManager | |
| private Boolean | isCustomCertificate(String alias)
Custom certificates are certificates with alias that ends with |
| private static void | mergeMissingBundledCertificates(Path storePath)
Adds any certificate present in the bundled |
| private static void |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| store | back to summary |
|---|---|
| private KeyStore store | |
| STORE_PASSWORD | back to summary |
|---|---|
| private static final String STORE_PASSWORD | |
| storePath | back to summary |
|---|---|
| private final Path storePath | |
| TrustStoreManager | back to summary |
|---|---|
| public TrustStoreManager(Path storePath) | |
| addCertificate | back to summary |
|---|---|
| public void addCertificate(@NonNull String alias, @NonNull Path certPath) | |
| aliases | back to summary |
|---|---|
| public List | |
| certificateExists | back to summary |
|---|---|
| public boolean certificateExists(@NonNull String alias) | |
| certsCount | back to summary |
|---|---|
| public int certsCount() | |
| clearCustomCertificates | back to summary |
|---|---|
| public void clearCustomCertificates() Deletes all custom certificates, Custom certificates are certificates with alias that ends with | |
| configureTrustStore | back to summary |
|---|---|
| private static void configureTrustStore(Path myStorePath) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, CertificateException, IOException
Implementation Note based on https://stackoverflow.com/a/62586564/3450689 | |
| createMergedTrustManager | back to summary |
|---|---|
| private static X509TrustManager createMergedTrustManager(X509TrustManager jreTrustManager, X509TrustManager customTrustManager) | |
| createTruststoreFileIfNotExist | back to summary |
|---|---|
| public static void createTruststoreFileIfNotExist(Path storePath) This method checks to see if the truststore is present in
| |
| deleteCertificate | back to summary |
|---|---|
| public void deleteCertificate(@NonNull String alias) | |
| findDefaultTrustManager | back to summary |
|---|---|
| private static X509TrustManager findDefaultTrustManager(KeyStore keyStore) throws NoSuchAlgorithmException, KeyStoreException | |
| flush | back to summary |
|---|---|
| public void flush() | |
| getCertificate | back to summary |
|---|---|
| public X509Certificate getCertificate(String alias) | |
| getCustomCertificates | back to summary |
|---|---|
| public List | |
| getJabRefTrustManager | back to summary |
|---|---|
| private static X509TrustManager getJabRefTrustManager(Path myStorePath) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException | |
| getJreTrustManager | back to summary |
|---|---|
| private static X509TrustManager getJreTrustManager() throws NoSuchAlgorithmException, KeyStoreException | |
| isCustomCertificate | back to summary |
|---|---|
| private Boolean isCustomCertificate(String alias) Custom certificates are certificates with alias that ends with | |
| mergeMissingBundledCertificates | back to summary |
|---|---|
| private static void mergeMissingBundledCertificates(Path storePath) Adds any certificate present in the bundled | |
| setSystemTrustManager | back to summary |
|---|---|
| private static void setSystemTrustManager(X509TrustManager mergedTrustManager) throws NoSuchAlgorithmException, KeyManagementException | |