Check in the onReceivedSslError() method of a WebViewClient if a certificate is signed from a specific self-signed CA
<p>I would like to override the <code>onReceivedSslError()</code> of a <code>WebViewClient</code>. Here I want to check if the <code>error.getCertificate()</code> certificate is signed from a self-signed CA and, <em>only in this case</em>, call the <code>handler.proceed()</code>. In pseudo-code:</p>

<pre><code>@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    SslCertificate serverCertificate = error.getCertificate();

    if (/* signed from my self-signed CA */) {
        handler.proceed();
    }
    else {
        super.onReceivedSslError(view, handler, error);
    }
}
</code></pre>

<p>The public key of my CA is saved in a BouncyCastle resource called <code>rootca.bks</code>. How can I do?</p>