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

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

Issue 323093003: Add the Sign-At-Most-Once restriction the enterprise.platformKeys API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 6 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.h
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys.h b/chrome/browser/chromeos/platform_keys/platform_keys.h
index de27fb4610741ef88fdc5b0aee3f65b01ce584a9..b4034ed150d886efac6e5563adc11a84e2c0d2d6 100644
--- a/chrome/browser/chromeos/platform_keys/platform_keys.h
+++ b/chrome/browser/chromeos/platform_keys/platform_keys.h
@@ -24,25 +24,23 @@ namespace chromeos {
namespace platform_keys {
-// If the generation was successful, |public_key_spki_der| will contain the DER
-// encoding of the SubjectPublicKeyInfo of the generated key and |error_message|
-// will be empty. If it failed, |public_key_spki_der| will be empty and
-// |error_message| contain an error message.
+namespace subtle {
+// Functions of this namespace shouldn't be called directly from the context of
+// an extension. Instead use PlatformKeysService which enforces restrictions
+// upon extensions.
+
typedef base::Callback<void(const std::string& public_key_spki_der,
const std::string& error_message)>
GenerateKeyCallback;
-// Generates a RSA key with |modulus_length|. |token_id| is currently ignored,
-// instead the user token associated with |profile| is always used. |callback|
-// will be invoked with the resulting public key or an error.
+// Generates a RSA key pair with |modulus_length_bits|. |token_id| is currently
+// ignored, instead the user token associated with |profile| is always used.
+// |callback| will be invoked with the resulting public key or an error.
void GenerateRSAKey(const std::string& token_id,
- unsigned int modulus_length,
+ unsigned int modulus_length_bits,
const GenerateKeyCallback& callback,
Profile* profile);
-// If signing was successful, |signature| will be contain the signature and
-// |error_message| will be empty. If it failed, |signature| will be empty and
-// |error_message| contain an error message.
typedef base::Callback<void(const std::string& signature,
const std::string& error_message)> SignCallback;
@@ -58,6 +56,8 @@ void Sign(const std::string& token_id,
const SignCallback& callback,
Profile* profile);
+} // namespace subtle
+
// If the list of certificates could be successfully retrieved, |certs| will
// contain the list of available certificates (maybe empty) and |error_message|
// will be empty. If an error occurred, |certs| will be empty and

Powered by Google App Engine
This is Rietveld 408576698