@Test
void v3InterCACert() throws Exception
{

    CertifiedPublicKey caCert = factory.decode(v3CaCert);
    CertifiedPublicKey interCaCert = factory.decode(v3InterCaCert);
    assertTrue(interCaCert.isSignedBy(caCert.getPublicKeyParameters()),
        "Intermediate CA certificate should be verified by CA.");
    assertThat(interCaCert, instanceOf(X509CertifiedPublicKey.class));
    X509CertifiedPublicKey cert = (X509CertifiedPublicKey) interCaCert;
    assertThat(cert.getVersionNumber(), equalTo(3));
    assertTrue(cert.getExtensions().isCritical(X509Extensions.BASIC_CONSTRAINTS_OID),
        "Basic constraints should be critical.");
    assertTrue(cert.getExtensions().hasCertificateAuthorityBasicConstraints(),
        "Basic constraints should be set to CA.");
    assertThat(cert.getExtensions().getBasicConstraintsPathLen(), equalTo(0));
    assertTrue(cert.getExtensions().isCritical(KeyUsage.OID), "KeyUsage extension should be critical.");
    assertThat(cert.getExtensions().getKeyUsage(), equalTo(EnumSet.of(KeyUsage.keyCertSign,
        KeyUsage.cRLSign)));
    assertThat(cert.getAuthorityKeyIdentifier(),
        equalTo(((X509CertifiedPublicKey) caCert).getSubjectKeyIdentifier()));
    assertThat(cert.isRootCA(), equalTo(false));
}