function certificatesRequestedListener(reportCallback) {
  log('The onCertificatesRequested event received');
  var response = [{
    certificate: TEST_CERTIFICATE,
    supportedHashes: TEST_CERTIFICATE_SUPPORTED_HASHES
  }];
  log('Responding with ' + response.length +
      ' certificate(s): ' + dumpCertificateInfos(response));
  reportCallback(response, function(rejectedCertificates) {
    if (chrome.runtime.lastError) {
      logError(
          'Failed to report the certificates: ' +
          chrome.runtime.lastError.message);
      return;
    }
    if (rejectedCertificates.length) {
      logError(
          rejectedCertificates.length + ' certificate(s) were rejected: ' +
          dumpArrayBuffers(rejectedCertificates));
      return;
    }
    log('Successfully reported the certificates');
  });
}
// Listener for the chrome.certificateProvider.onCertificatesRequested event.
Listener for the chrome.certificateProvider.onCertificatesRequested event.
Listener for the chrome . certificateProvider . onCertificatesRequested event .
function certificatesRequestedListener(reportCallback) {
  log('The onCertificatesRequested event received');
  var response = [{
    certificate: TEST_CERTIFICATE,
    supportedHashes: TEST_CERTIFICATE_SUPPORTED_HASHES
  }];
  log('Responding with ' + response.length +
      ' certificate(s): ' + dumpCertificateInfos(response));
  reportCallback(response, function(rejectedCertificates) {
    if (chrome.runtime.lastError) {
      logError(
          'Failed to report the certificates: ' +
          chrome.runtime.lastError.message);
      return;
    }
    if (rejectedCertificates.length) {
      logError(
          rejectedCertificates.length + ' certificate(s) were rejected: ' +
          dumpArrayBuffers(rejectedCertificates));
      return;
    }
    log('Successfully reported the certificates');
  });
}
function certificatesRequestedListener ( reportCallback ) { log ( 'The onCertificatesRequested event received' ) ; var response = [ { certificate : TEST_CERTIFICATE , supportedHashes : TEST_CERTIFICATE_SUPPORTED_HASHES } ] ; log ( 'Responding with ' + response . length + ' certificate(s): ' + dumpCertificateInfos ( response ) ) ; reportCallback ( response , function ( rejectedCertificates ) { if ( chrome . runtime . lastError ) { logError ( 'Failed to report the certificates: ' + chrome . runtime . lastError . message ) ; return ; } if ( rejectedCertificates . length ) { logError ( rejectedCertificates . length + ' certificate(s) were rejected: ' + dumpArrayBuffers ( rejectedCertificates ) ) ; return ; } log ( 'Successfully reported the certificates' ) ; } ) ; }
Listener for the chrome.certificateProvider.onCertificatesRequested event.
Listener for the chrome . certificateProvider . onCertificatesRequested event .