getCertificates method

Future<List<ByteBuffer>> getCertificates(
  1. String tokenId
)

Returns the list of all client certificates available from the given token. Can be used to check for the existence and expiration of client certificates that are usable for a certain authentication. |tokenId|: The id of a Token returned by getTokens. |callback|: Called back with the list of the available certificates.

Implementation

Future<List<ByteBuffer>> getCertificates(String tokenId) {
  var $completer = Completer<List<ByteBuffer>>();
  $js.chrome.enterprise.platformKeys.getCertificates(
    tokenId,
    (JSArray certificates) {
      if (checkRuntimeLastError($completer)) {
        $completer.complete(certificates.toDart
            .cast<JSArrayBuffer>()
            .map((e) => e.toDart)
            .toList());
      }
    }.toJS,
  );
  return $completer.future;
}