@Test public void testJksKeyStoreRoundTrip() throws GeneralSecurityException, IOException { testKeyStoreRoundTrip(() -> KeyStoreUtils.getKeyStore(KeystoreType.JKS.toString().toLowerCase())); }
public static KeyStore getKeyStore(String keyStoreType) throws KeyStoreException { String keyStoreProvider = getKeyStoreProvider(keyStoreType); if (StringUtils.isNotEmpty(keyStoreProvider)) { try { return KeyStore.getInstance(keyStoreType, keyStoreProvider); } catch (Exception e) { logger.error("Unable to load " + keyStoreProvider + " " + keyStoreType + " keystore. This may cause issues getting trusted CA certificates as well as Certificate Chains for use in TLS.", e); } } return KeyStore.getInstance(keyStoreType); }
KeyStoreUtils { public static KeyStore getKeyStore(String keyStoreType) throws KeyStoreException { String keyStoreProvider = getKeyStoreProvider(keyStoreType); if (StringUtils.isNotEmpty(keyStoreProvider)) { try { return KeyStore.getInstance(keyStoreType, keyStoreProvider); } catch (Exception e) { logger.error("Unable to load " + keyStoreProvider + " " + keyStoreType + " keystore. This may cause issues getting trusted CA certificates as well as Certificate Chains for use in TLS.", e); } } return KeyStore.getInstance(keyStoreType); } }
KeyStoreUtils { public static KeyStore getKeyStore(String keyStoreType) throws KeyStoreException { String keyStoreProvider = getKeyStoreProvider(keyStoreType); if (StringUtils.isNotEmpty(keyStoreProvider)) { try { return KeyStore.getInstance(keyStoreType, keyStoreProvider); } catch (Exception e) { logger.error("Unable to load " + keyStoreProvider + " " + keyStoreType + " keystore. This may cause issues getting trusted CA certificates as well as Certificate Chains for use in TLS.", e); } } return KeyStore.getInstance(keyStoreType); }  }
KeyStoreUtils { public static KeyStore getKeyStore(String keyStoreType) throws KeyStoreException { String keyStoreProvider = getKeyStoreProvider(keyStoreType); if (StringUtils.isNotEmpty(keyStoreProvider)) { try { return KeyStore.getInstance(keyStoreType, keyStoreProvider); } catch (Exception e) { logger.error("Unable to load " + keyStoreProvider + " " + keyStoreType + " keystore. This may cause issues getting trusted CA certificates as well as Certificate Chains for use in TLS.", e); } } return KeyStore.getInstance(keyStoreType); }  static String getKeyStoreProvider(String keyStoreType); static KeyStore getKeyStore(String keyStoreType); static KeyStore getTrustStore(String trustStoreType); }
KeyStoreUtils { public static KeyStore getKeyStore(String keyStoreType) throws KeyStoreException { String keyStoreProvider = getKeyStoreProvider(keyStoreType); if (StringUtils.isNotEmpty(keyStoreProvider)) { try { return KeyStore.getInstance(keyStoreType, keyStoreProvider); } catch (Exception e) { logger.error("Unable to load " + keyStoreProvider + " " + keyStoreType + " keystore. This may cause issues getting trusted CA certificates as well as Certificate Chains for use in TLS.", e); } } return KeyStore.getInstance(keyStoreType); }  static String getKeyStoreProvider(String keyStoreType); static KeyStore getKeyStore(String keyStoreType); static KeyStore getTrustStore(String trustStoreType);  }