Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1150)

Unified Diff: chrome/browser/chromeos/platform_keys/platform_keys_service.cc

Issue 875373002: First implementation of chrome.platformKeys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_idl
Patch Set: Rebased. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/platform_keys/platform_keys_service.cc
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys_service.cc b/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
index ebaed7ba5e3840c0e812946239fb8e389ad3fdfc..07974de472282dbc5ac5757c0e79498c92638fdd 100644
--- a/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
+++ b/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/chromeos/platform_keys/platform_keys.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/state_store.h"
+#include "net/cert/x509_certificate.h"
using content::BrowserThread;
@@ -110,6 +111,19 @@ void PlatformKeysService::Sign(const std::string& token_id,
browser_context_));
}
+void PlatformKeysService::SelectClientCertificates(
+ const platform_keys::ClientCertificateRequest& request,
+ const std::string& extension_id,
+ const SelectCertificatesCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ platform_keys::subtle::SelectClientCertificates(
+ request,
+ base::Bind(&PlatformKeysService::SelectClientCertificatesCallback,
+ weak_factory_.GetWeakPtr(), extension_id, callback),
+ browser_context_);
+}
+
void PlatformKeysService::RegisterPublicKey(
const std::string& extension_id,
const std::string& public_key_spki_der,
@@ -165,6 +179,15 @@ void PlatformKeysService::GenerateRSAKeyCallback(
RegisterPublicKey(extension_id, public_key_spki_der, wrapped_callback);
}
+void PlatformKeysService::SelectClientCertificatesCallback(
+ const std::string& extension_id,
+ const SelectCertificatesCallback& callback,
+ scoped_ptr<net::CertificateList> matches,
+ const std::string& error_message) {
+ // TODO(pneubeck): Remove all certs that the extension doesn't have access to.
+ callback.Run(matches.Pass(), error_message);
+}
+
void PlatformKeysService::RegisterPublicKeyGotPlatformKeys(
const std::string& extension_id,
const std::string& public_key_spki_der,

Powered by Google App Engine
This is Rietveld 408576698