importCertificate method
Imports certificate to the given token if the certified key
is already stored in this token.
After a successful certification request, this function should be used to
store the obtained certificate and to make it available to the operating
system and browser for authentication.
|tokenId|: The id of a Token returned by getTokens.
|certificate|: The DER encoding of a X.509 certificate.
|callback|: Called back when this operation is finished.
Implementation
Future<void> importCertificate(
  String tokenId,
  ByteBuffer certificate,
) {
  var $completer = Completer<void>();
  $js.chrome.enterprise.platformKeys.importCertificate(
    tokenId,
    certificate.toJS,
    () {
      if (checkRuntimeLastError($completer)) {
        $completer.complete(null);
      }
    }.toJS,
  );
  return $completer.future;
}