@Test
    public void testV1Cert() {
        ServiceTester tester = ServiceTester.test("CertificateFactory").withAlgorithm("X509");
        tester.run((p, algorithm) -> {
            X509Certificate c = certificateFromPEM(p, X509V1_CERT);

            // Check basic certificate properties.
            assertEquals(1, c.getVersion());
            assertEquals(new BigInteger("d94c04da497dbfeb", 16), c.getSerialNumber());
            assertDatesEqual(
                    dateFromUTC(2014, Calendar.APRIL, 23, 23, 21, 57), c.getNotBefore());
            assertDatesEqual(dateFromUTC(2014, Calendar.MAY, 23, 23, 21, 57), c.getNotAfter());
            assertEquals(new X500Principal("CN=Test Issuer"), c.getIssuerX500Principal());
            assertEquals(new X500Principal("CN=Test Subject"), c.getSubjectX500Principal());
            assertEquals("1.2.840.10045.4.1", c.getSigAlgOID());
            String signatureHex = "3045022100f2a0355e513a36c382799bee27"
                    + "50858e7006749557d2297400f4be15875dc4"
                    + "0702207c1e79146a2183f07a7468795f1499"
                    + "9a68b4f1cb9e155ee61f3252615e75c914";
            assertArrayEquals(TestUtils.decodeHex(signatureHex), c.getSignature());

            // ECDSA signature AlgorithmIdentifiers omit parameters.
            assertNull(c.getSigAlgParams());

            // The certificate does not have UIDs.
            assertNull(c.getIssuerUniqueID());
            assertNull(c.getSubjectUniqueID());

            // The certificate does not have any extensions.
            assertEquals(-1, c.getBasicConstraints());
            assertNull(c.getExtendedKeyUsage());
            assertNull(c.getIssuerAlternativeNames());
            assertNull(c.getKeyUsage());
            assertNull(c.getSubjectAlternativeNames());
        });
    }
Confirm that explicit EC params aren't accepted in certificates.
common/src/test/java/org/conscrypt/java/security/cert/X509CertificateTest.java