public static ClientCertificate convert(
            Type type, Server server, String path, char[] storePassword, char[] keyPassword) throws Exception {

        // Load KeyStore
        FileInputStream fis = new FileInputStream(path);
        KeyStore ks = KeyStore.getInstance(type.getText());
        ks.load(fis, storePassword);
        fis.close();

        // Get an alias of FIRST ONLY!!!
        String alias = ks.aliases().nextElement();

        // Extract CommonName and Issuer
        X509Certificate crt = (X509Certificate) ks.getCertificate(alias);
        String subject = getCommonName(crt.getSubjectDN().getName());
        String issuer = crt.getIssuerDN().getName();

        return new ClientCertificate(type, server, subject, issuer, path, String.valueOf(storePassword), String.valueOf(keyPassword));
    }
Convert from Client Certificate file into this model
@param type: Certificate Type (e.g. PKCS#12, JKS)
@param server: Applied Server
@param path: Certificate Path on File System
@param storePassword: Password for Certificate
@param keyPassword: Password for Private Key
@return Model for Client Certificate
@throws Exception:
            - IOException
            - FileNotFoundException
            - KeyStoreException
            - NoSuchAlgorithmException
            - CertificateException
src/main/java/core/packetproxy/model/ClientCertificate.java