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

Unified Diff: content/browser/experiments/api_key.h

Issue 1522813002: Add public key and signature verification to browser-side API keys (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@keys
Patch Set: Add TODOs for future work Created 5 years 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 | « no previous file | content/browser/experiments/api_key.cc » ('j') | content/browser/experiments/api_key.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/experiments/api_key.h
diff --git a/content/browser/experiments/api_key.h b/content/browser/experiments/api_key.h
index c11f3f2b16a3596b7bb7c02383af08e6972fe089..159375112d45f7113b55a5ab18a7dd295390c8c5 100644
--- a/content/browser/experiments/api_key.h
+++ b/content/browser/experiments/api_key.h
@@ -39,6 +39,16 @@ class CONTENT_EXPORT ApiKey {
std::string api_name() { return api_name_; }
uint64_t expiry_timestamp() { return expiry_timestamp_; }
+ protected:
+ friend class ApiKeyTest;
+
+ bool ValidateDate(const base::Time& now) const;
+ bool ValidateSignature(const char* publicKeyPEM) const;
davidben 2015/12/18 22:23:17 public_key_pem
iclelland 2015/12/22 05:45:28 Done. Actually changed to uint8_t* public_key (dro
+
+ static bool ValidateSignature(const std::string& signatureText,
davidben 2015/12/18 22:23:17 signature_text
iclelland 2015/12/22 05:45:28 Done.
+ const std::string& data,
+ const char* publicKeyPEM);
davidben 2015/12/18 22:23:17 public_key_pem
iclelland 2015/12/22 05:45:28 Done.
+
private:
ApiKey();
ApiKey(const std::string& signature,
« no previous file with comments | « no previous file | content/browser/experiments/api_key.cc » ('j') | content/browser/experiments/api_key.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698