check

suspend fun check(cert: X509Certificate, appInForeground: Boolean): Boolean

Tries to retrieve a trust decision from the user about a given certificate.

Thread-safe, can handle multiple requests for various certificates and/or the same certificate at once.

Return

true if the user explicitly trusts the certificate, false if unknown or untrusted

Parameters

cert

certificate to ask user about

appInForeground

whether the app is currently in foreground = whether it can directly launch an Activity