| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 std::vector<uint8>* OUT_signature) = 0; | 33 std::vector<uint8>* OUT_signature) = 0; |
| 34 | 34 |
| 35 // Fetch the value associated with |name|, if its present. | 35 // Fetch the value associated with |name|, if its present. |
| 36 // If so, we return true, store the info in |OUT_value|, and store the | 36 // If so, we return true, store the info in |OUT_value|, and store the |
| 37 // signature passed when the property was initially stored in |OUT_signature|. | 37 // signature passed when the property was initially stored in |OUT_signature|. |
| 38 // If not, we return false and don't touch the output parameters. | 38 // If not, we return false and don't touch the output parameters. |
| 39 virtual bool RetrieveProperty(const std::string& name, | 39 virtual bool RetrieveProperty(const std::string& name, |
| 40 std::string* OUT_value, | 40 std::string* OUT_value, |
| 41 std::vector<uint8>* OUT_signature) = 0; | 41 std::vector<uint8>* OUT_signature) = 0; |
| 42 | 42 |
| 43 // Attempts to asynchronously set the provided public key as the | |
| 44 // Owner's public key for this device. |public_key_der| should be a | |
| 45 // DER-encoded PKCS11 SubjectPublicKeyInfo structure. | |
| 46 // Returns true if the attempt was successfully started. | |
| 47 // callback->Run() will be called when the operation is complete. | |
| 48 virtual bool SetOwnerKeyAsync(const std::vector<uint8>& public_key_der, | |
| 49 Delegate* callback) = 0; | |
| 50 | |
| 51 // Attempts to issue a signed async request to store |name|=|value|. | 43 // Attempts to issue a signed async request to store |name|=|value|. |
| 52 // |signature| must by a SHA1 with RSA encryption signature over the string | 44 // |signature| must by a SHA1 with RSA encryption signature over the string |
| 53 // "name=value" with the owner's private key. | 45 // "name=value" with the owner's private key. |
| 54 // Returns true if the attempt was successfully started. | 46 // Returns true if the attempt was successfully started. |
| 55 // callback->Run() will be called when the operation is complete. | 47 // callback->Run() will be called when the operation is complete. |
| 56 virtual bool StorePropertyAsync(const std::string& name, | 48 virtual bool StorePropertyAsync(const std::string& name, |
| 57 const std::string& value, | 49 const std::string& value, |
| 58 const std::vector<uint8>& signature, | 50 const std::vector<uint8>& signature, |
| 59 Delegate* callback) = 0; | 51 Delegate* callback) = 0; |
| 60 | 52 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 virtual bool RestartJob(int pid, const std::string& command_line) = 0; | 94 virtual bool RestartJob(int pid, const std::string& command_line) = 0; |
| 103 | 95 |
| 104 // Factory function, creates a new instance and returns ownership. | 96 // Factory function, creates a new instance and returns ownership. |
| 105 // For normal usage, access the singleton via CrosLibrary::Get(). | 97 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 106 static LoginLibrary* GetImpl(bool stub); | 98 static LoginLibrary* GetImpl(bool stub); |
| 107 }; | 99 }; |
| 108 | 100 |
| 109 } // namespace chromeos | 101 } // namespace chromeos |
| 110 | 102 |
| 111 #endif // CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ | 103 #endif // CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ |
| OLD | NEW |