class X509Util implements Closeable, AutoCloseable {

    public static X509KeyManager createKeyManager(
            String keyStoreLocation,
            String keyStorePassword,
            String keyStoreTypeProp)
            throws KeyManagerException {
        if (keyStorePassword == null) {
            keyStorePassword = "";
        }
        try {
            KeyStoreFileType storeFileType =
                    KeyStoreFileType.fromPropertyValueOrFileName(
                            keyStoreTypeProp, keyStoreLocation);
            KeyStore ks = FileKeyStoreLoaderBuilderProvider
                    .getBuilderForKeyStoreFileType(storeFileType)
                    .setKeyStorePath(keyStoreLocation)
                    .setKeyStorePassword(keyStorePassword)
                    .build()
                    .loadKeyStore();
            KeyManagerFactory kmf = KeyManagerFactory.getInstance("PKIX");
            kmf.init(ks, keyStorePassword.toCharArray());

            for (KeyManager km : kmf.getKeyManagers()) {
                if (km instanceof X509KeyManager) {
                    return (X509KeyManager) km;
                }
            }
            throw new KeyManagerException("Couldn't find X509KeyManager");
        } catch (IOException | GeneralSecurityException | IllegalArgumentException e) {
            throw new KeyManagerException(e);
        }
    }

    public  X509Util();
    public  X509Util(ZKConfig zkConfig);

}