verifyTLSServerCertificate method

Future<VerificationResult> verifyTLSServerCertificate(
  1. VerificationDetails details
)

Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names.

Implementation

Future<VerificationResult> verifyTLSServerCertificate(
    VerificationDetails details) {
  var $completer = Completer<VerificationResult>();
  $js.chrome.platformKeys.verifyTLSServerCertificate(
    details.toJS,
    ($js.VerificationResult result) {
      if (checkRuntimeLastError($completer)) {
        $completer.complete(VerificationResult.fromJS(result));
      }
    }.toJS,
  );
  return $completer.future;
}