@Test
public void testExtractX509CertCommonName() throws Exception {

    try (InputStream inStream = new FileInputStream("src/test/resources/valid_cn_x509.cert")) {
        CertificateFactory cf = CertificateFactory.getInstance("X.509");
        X509Certificate cert = (X509Certificate) cf.generateCertificate(inStream);
        String cn = Crypto.extractX509CertCommonName(cert);
        assertEquals("athenz.syncer", cn);
    }
}