@Test
public void testExtractX509CertOField() 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 o = Crypto.extractX509CertSubjectOField(cert);
        assertEquals("My Test Company", o);
    }
}