OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_PLATFORM_KEYS_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_PLATFORM_KEYS_API_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 11 |
| 12 namespace extensions { |
| 13 namespace platform_keys { |
| 14 |
| 15 extern const char kErrorInvalidToken[]; |
| 16 |
| 17 // Returns whether |token_id| references a known Token. |
| 18 bool ValidateToken(const std::string& token_id, |
| 19 std::string* platform_keys_token_id); |
| 20 |
| 21 // Converts a token id from ::chromeos::platform_keys to the platformKeys API |
| 22 // token id. |
| 23 std::string PlatformKeysTokenIdToApiId( |
| 24 const std::string& platform_keys_token_id); |
| 25 |
| 26 } // namespace platform_keys |
| 27 |
| 28 class PlatformKeysInternalSignFunction |
| 29 : public ChromeUIThreadExtensionFunction { |
| 30 private: |
| 31 ~PlatformKeysInternalSignFunction() override; |
| 32 ResponseAction Run() override; |
| 33 |
| 34 // Called when the signature was generated. If an error occurred, |
| 35 // |signature| will be empty and instead |error_message| be set. |
| 36 void OnSigned(const std::string& signature, const std::string& error_message); |
| 37 |
| 38 DECLARE_EXTENSION_FUNCTION("platformKeysInternal.sign", |
| 39 PLATFORMKEYSINTERNAL_SIGN); |
| 40 }; |
| 41 |
| 42 } // namespace extensions |
| 43 |
| 44 #endif // CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_PLATFORM_KEYS_API_H_ |
OLD | NEW |