public static String getCertFingerPrint(Certificate cert)  {
        byte [] digest = null;
        try {
            byte[] encCertInfo = cert.getEncoded();
            MessageDigest md = MessageDigest.getInstance("SHA-1");
            digest = md.digest(encCertInfo);
        } catch (Exception e) {
            logger.error("Exception:", e);
        }
        if (digest != null) {
            return bytesToHex(digest).toLowerCase();
        }
        return null;
    }
@Test
    public void testGetCertFingerPrintCa() throws Exception {
        X509Certificate cert = null;
        try (InputStream is = Config.getInstance().getInputStreamFromFile("ca.crt")){
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
            cert = (X509Certificate) cf.generateCertificate(is);
        } catch (Exception e) {
            e.printStackTrace();
        }
        String fp = FingerPrintUtil.getCertFingerPrint(cert);
        Assert.assertEquals("da2794f442f08a73ac9eef7f9378dd7a5bbcf8c6", fp);
    }