Example usage for android.webkit WebView getCertificate

List of usage examples for android.webkit WebView getCertificate

Introduction

In this page you can find the example usage for android.webkit WebView getCertificate.

Prototype

@Nullable
public SslCertificate getCertificate() 

Source Link

Document

Gets the SSL certificate for the main top-level page or null if there is no certificate (the site is not secure).

Usage

From source file:org.mozilla.focus.webkit.FocusWebViewClient.java

@Override
public void onPageFinished(WebView view, final String url) {
    if (callback != null) {
        callback.onPageFinished(view.getCertificate() != null);
        // The URL which is supplied in onPageFinished() could be fake (see #301), but webview's
        // URL is always correct _except_ for error pages
        final String viewURL = view.getUrl();
        if (!UrlUtils.isInternalErrorURL(viewURL)) {
            callback.onURLChanged(view.getUrl());
        }/*from ww  w . j a  v  a  2 s  .co m*/
    }
    super.onPageFinished(view, url);

    view.evaluateJavascript("(function() {" +

            CLEAR_VISITED_CSS +

            "})();",

            null);
}