private static void verifyCertificateWithClient(final X509Client client) throws CertificateException {
        if (!client.isInitialized()) {
            client.init();
        }
        val context = MockWebContext.create();
        val certificateData = Base64.getDecoder().decode(CERTIFICATE);
        val cert = (X509Certificate) CertificateFactory.getInstance("X.509")
            .generateCertificate(new ByteArrayInputStream(certificateData));
        val certs = new X509Certificate[1];
        certs[0] = cert;
        val credentialsExtractor = (X509CredentialsExtractor) client.getCredentialsExtractor();
        context.setRequestAttribute(credentialsExtractor.getHeaderName(), certs);
        val ctx = new CallContext(context, new MockSessionStore());
        val credentials = (X509Credentials) client.getCredentials(ctx).get();
        val authnCredentials = client.validateCredentials(ctx, credentials).get();
        val profile = (X509Profile) client.getUserProfile(ctx, authnCredentials).get();
        assertEquals("jerome", profile.getId());
        assertEquals("CN=jerome, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown", profile.getAttribute("x509-subjectDN"));
        assertTrue(profile.containsAttribute("x509-certificate"));
    }
Tests {@link X509Client}.

@author Jerome Leleu
@since 3.3.0
pac4j-http/src/test/java/org/pac4j/http/client/direct/X509ClientTests.java