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

Unified Diff: chrome/browser/extensions/api/platform_keys/platform_keys_api.h

Issue 847333004: Move parts from enterprise.platformKeysInternal to platformKeysInternal for reuse. (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/extensions/api/platform_keys/platform_keys_api.h
diff --git a/chrome/browser/extensions/api/platform_keys/platform_keys_api.h b/chrome/browser/extensions/api/platform_keys/platform_keys_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..def650cba6c03fabc13a0eb5b9ec75a785c50017
--- /dev/null
+++ b/chrome/browser/extensions/api/platform_keys/platform_keys_api.h
@@ -0,0 +1,44 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_PLATFORM_KEYS_API_H_
+#define CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_PLATFORM_KEYS_API_H_
+
+#include <string>
+
+#include "chrome/browser/extensions/chrome_extension_function.h"
+
+namespace extensions {
+namespace platform_keys {
+
+extern const char kErrorInvalidToken[];
+
+// Returns whether |token_id| references a known Token.
+bool ValidateToken(const std::string& token_id,
+ std::string* platform_keys_token_id);
+
+// Converts a token id from ::chromeos::platform_keys to the platformKeys API
+// token id.
+std::string PlatformKeysTokenIdToApiId(
+ const std::string& platform_keys_token_id);
+
+} // namespace platform_keys
+
+class PlatformKeysInternalSignFunction
+ : public ChromeUIThreadExtensionFunction {
+ private:
+ ~PlatformKeysInternalSignFunction() override;
+ ResponseAction Run() override;
+
+ // Called when the signature was generated. If an error occurred,
+ // |signature| will be empty and instead |error_message| be set.
+ void OnSigned(const std::string& signature, const std::string& error_message);
+
+ DECLARE_EXTENSION_FUNCTION("platformKeysInternal.sign",
+ PLATFORMKEYSINTERNAL_SIGN);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_PLATFORM_KEYS_API_H_

Powered by Google App Engine
This is Rietveld 408576698