Utils { public static KeyManager[] getKeyManagers(final String athenzPublicCert, final String athenzPrivateKey) throws FileNotFoundException, IOException, InterruptedException, KeyRefresherException { final KeyStore keystore = createKeyStore(athenzPublicCert, athenzPrivateKey); KeyManagerFactory keyManagerFactory = null; try { keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); keyManagerFactory.init(keystore, KEYSTORE_PASSWORD); } catch (NoSuchAlgorithmException e) { throw new KeyRefresherException("No Provider supports a KeyManagerFactorySpi implementation for the specified algorithm.", e); } catch (UnrecoverableKeyException e) { throw new KeyRefresherException("key cannot be recovered (e.g. the given password is wrong).", e); } catch (KeyStoreException e) { throw new KeyRefresherException("Unable to initialize KeyManagerFactory.", e); } return keyManagerFactory.getKeyManagers(); }  static KeyStore getKeyStore(final String jksFilePath); static KeyStore getKeyStore(final String jksFilePath, final char[] password); static KeyManager[] getKeyManagers(final String athenzPublicCert, final String athenzPrivateKey); static KeyRefresher generateKeyRefresher(final String trustStorePath,
                                                    final String athenzPublicCert, final String athenzPrivateKey); static KeyRefresher generateKeyRefresher(final String trustStorePath,
                                                    final String trustStorePassword, final String athenzPublicCert, final String athenzPrivateKey); static KeyRefresher generateKeyRefresher(final String trustStorePath,
                                                    final char[] trustStorePassword, final String athenzPublicCert, final String athenzPrivateKey); static KeyRefresher generateKeyRefresher(final String trustStorePath,
                                                    final char[] trustStorePassword, final String athenzPublicCert,
                                                    final String athenzPrivateKey, final KeyRefresherListener keyRefresherListener); static KeyRefresher generateKeyRefresherFromCaCert(final String caCertPath,
                                                              final String athenzPublicCert, final String athenzPrivateKey); static SSLContext buildSSLContext(KeyManagerProxy keyManagerProxy,
                                             TrustManagerProxy trustManagerProxy); static KeyStore createKeyStore(final String athenzPublicCert, final String athenzPrivateKey); static KeyStore createKeyStoreFromPems(
            final String athenzPublicCertPem,
            final String athenzPrivateKeyPem); static KeyStore createKeyStore(
            final Supplier<InputStream> athenzPublicCertInputStream,
            final Supplier<String> athenzPublicCertLocationSupplier,
            final Supplier<InputStream> athenzPrivateKeyInputStream,
            final Supplier<String> athenzPrivateKeyLocationSupplier); static KeyStore generateTrustStore(InputStream inputStream);  }
@Test (expected = FileNotFoundException.class) public void getKeyManagersTest() throws FileNotFoundException, IOException, InterruptedException, KeyRefresherException { Utils.getKeyManagers(null, null); Assert.fail("Should have thrown FileNotFoundException."); }