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

Unified Diff: chrome/browser/chromeos/platform_keys/platform_keys.h

Issue 875373002: First implementation of chrome.platformKeys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_idl
Patch Set: Fix .gn file. Created 5 years, 10 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/platform_keys/platform_keys.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/platform_keys/platform_keys.h
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys.h b/chrome/browser/chromeos/platform_keys/platform_keys.h
index b16504e9b5f443de5e8eb97b63d7369b23189afb..05d0deff4c727389132ad45e17c9884cda2e8e55 100644
--- a/chrome/browser/chromeos/platform_keys/platform_keys.h
+++ b/chrome/browser/chromeos/platform_keys/platform_keys.h
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "net/ssl/ssl_client_cert_type.h"
namespace content {
class BrowserContext;
@@ -43,6 +44,19 @@ enum HashAlgorithm {
HASH_ALGORITHM_SHA512
};
+struct ClientCertificateRequest {
+ ClientCertificateRequest();
+ ~ClientCertificateRequest();
+
+ // The list of the types of certificates requested, sorted in order of the
+ // server's preference.
+ std::vector<net::SSLClientCertType> certificate_key_types;
+
+ // List of distinguished names of certificate authorities allowed by the
+ // server. Each entry must be a DER-encoded X.509 DistinguishedName.
+ std::vector<std::string> certificate_authorities;
+};
+
namespace subtle {
// Functions of this namespace shouldn't be called directly from the context of
// an extension. Instead use PlatformKeysService which enforces restrictions
@@ -77,6 +91,20 @@ void Sign(const std::string& token_id,
const SignCallback& callback,
content::BrowserContext* browser_context);
+// If the certificate request could be processed successfully, |matches| will
+// contain the list of matching certificates (which may be empty) and
+// |error_message| will be empty. If an error occurred, |matches| will be null
+// and |error_message| contain an error message.
+typedef base::Callback<void(scoped_ptr<net::CertificateList> matches,
+ const std::string& error_message)>
+ SelectCertificatesCallback;
+
+// Returns the list of all certificates that match |request|. |callback| will be
+// invoked with these matches or an error message.
+void SelectClientCertificates(const ClientCertificateRequest& request,
+ const SelectCertificatesCallback& callback,
+ content::BrowserContext* browser_context);
+
} // namespace subtle
// If the list of certificates could be successfully retrieved, |certs| will
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/platform_keys/platform_keys.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698