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

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

Issue 331173002: enterprise.platformKeys: Respect the 'hash' argument of generateKey. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/platform_keys/platform_keys_nss.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 a1a4827aaf2f7dd0d1771541add714290f25004a..2a61275963f0b9738da02a3121fcd031479836fd 100644
--- a/chrome/browser/chromeos/platform_keys/platform_keys.h
+++ b/chrome/browser/chromeos/platform_keys/platform_keys.h
@@ -26,6 +26,14 @@ namespace chromeos {
namespace platform_keys {
+// Supported hash algorithms.
+enum HashAlgorithm {
+ HASH_ALGORITHM_SHA1,
+ HASH_ALGORITHM_SHA256,
+ HASH_ALGORITHM_SHA384,
+ HASH_ALGORITHM_SHA512
+};
+
namespace subtle {
// Functions of this namespace shouldn't be called directly from the context of
// an extension. Instead use PlatformKeysService which enforces restrictions
@@ -46,14 +54,16 @@ void GenerateRSAKey(const std::string& token_id,
typedef base::Callback<void(const std::string& signature,
const std::string& error_message)> SignCallback;
-// Signs |data| with the private key matching |public_key|, if that key is
-// stored in the given token. |token_id| is currently ignored, instead the user
-// token associated with |browser_context| is always used. |public_key| must be
-// the DER encoding of a SubjectPublicKeyInfo. |callback| will be invoked with
-// the signature or an error message.
+// Digests |data| with |hash_algorithm| and afterwards signs the digest with the
+// private key matching |public_key|, if that key is stored in the given token.
+// |token_id| is currently ignored, instead the user token associated with
+// |browser_context| is always used. |public_key| must be the DER encoding of a
+// SubjectPublicKeyInfo. |callback| will be invoked with the signature or an
+// error message.
// Currently supports RSA keys only.
void Sign(const std::string& token_id,
const std::string& public_key,
+ HashAlgorithm hash_algorithm,
const std::string& data,
const SignCallback& callback,
content::BrowserContext* browser_context);
« no previous file with comments | « no previous file | chrome/browser/chromeos/platform_keys/platform_keys_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698