OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ |
6 #define CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ | 6 #define CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool return_status, | 28 bool return_status, |
29 int return_code)> | 29 int return_code)> |
30 AsyncCallStatusHandler; | 30 AsyncCallStatusHandler; |
31 // A callback to handle AsyncCallStatusWithData signals. | 31 // A callback to handle AsyncCallStatusWithData signals. |
32 typedef base::Callback<void(int async_id, | 32 typedef base::Callback<void(int async_id, |
33 bool return_status, | 33 bool return_status, |
34 const std::string& data)> | 34 const std::string& data)> |
35 AsyncCallStatusWithDataHandler; | 35 AsyncCallStatusWithDataHandler; |
36 // A callback to handle responses of AsyncXXX methods. | 36 // A callback to handle responses of AsyncXXX methods. |
37 typedef base::Callback<void(int async_id)> AsyncMethodCallback; | 37 typedef base::Callback<void(int async_id)> AsyncMethodCallback; |
| 38 // A callback for GetSystemSalt(). |
| 39 typedef base::Callback<void( |
| 40 DBusMethodCallStatus call_status, |
| 41 const std::vector<uint8>& system_salt)> GetSystemSaltCallback; |
38 // A callback for WaitForServiceToBeAvailable(). | 42 // A callback for WaitForServiceToBeAvailable(). |
39 typedef base::Callback<void(bool service_is_ready)> | 43 typedef base::Callback<void(bool service_is_ready)> |
40 WaitForServiceToBeAvailableCallback; | 44 WaitForServiceToBeAvailableCallback; |
41 // A callback to handle responses of Pkcs11GetTpmTokenInfo method. The result | 45 // A callback to handle responses of Pkcs11GetTpmTokenInfo method. The result |
42 // of the D-Bus call is in |call_status|. On success, |label| holds the | 46 // of the D-Bus call is in |call_status|. On success, |label| holds the |
43 // PKCS #11 token label. This is not useful in practice to identify a token | 47 // PKCS #11 token label. This is not useful in practice to identify a token |
44 // but may be meaningful to a user. The |user_pin| can be used with the | 48 // but may be meaningful to a user. The |user_pin| can be used with the |
45 // C_Login PKCS #11 function but is not necessary because tokens are logged in | 49 // C_Login PKCS #11 function but is not necessary because tokens are logged in |
46 // for the duration of a signed-in session. The |slot| corresponds to a | 50 // for the duration of a signed-in session. The |slot| corresponds to a |
47 // CK_SLOT_ID for the PKCS #11 API and reliably identifies the token for the | 51 // CK_SLOT_ID for the PKCS #11 API and reliably identifies the token for the |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 virtual void AsyncMigrateKey(const std::string& username, | 102 virtual void AsyncMigrateKey(const std::string& username, |
99 const std::string& from_key, | 103 const std::string& from_key, |
100 const std::string& to_key, | 104 const std::string& to_key, |
101 const AsyncMethodCallback& callback) = 0; | 105 const AsyncMethodCallback& callback) = 0; |
102 | 106 |
103 // Calls AsyncRemove method. |callback| is called after the method call | 107 // Calls AsyncRemove method. |callback| is called after the method call |
104 // succeeds. | 108 // succeeds. |
105 virtual void AsyncRemove(const std::string& username, | 109 virtual void AsyncRemove(const std::string& username, |
106 const AsyncMethodCallback& callback) = 0; | 110 const AsyncMethodCallback& callback) = 0; |
107 | 111 |
108 // Calls GetSystemSalt method. This method blocks until the call returns. | 112 // Calls GetSystemSalt method. |callback| is called after the method call |
109 // The original content of |salt| is lost. | 113 // succeeds. |
110 virtual bool GetSystemSalt(std::vector<uint8>* salt) = 0; | 114 virtual void GetSystemSalt(const GetSystemSaltCallback& callback) = 0; |
111 | 115 |
112 // Calls GetSanitizedUsername method. |callback| is called after the method | 116 // Calls GetSanitizedUsername method. |callback| is called after the method |
113 // call succeeds. | 117 // call succeeds. |
114 virtual void GetSanitizedUsername( | 118 virtual void GetSanitizedUsername( |
115 const std::string& username, | 119 const std::string& username, |
116 const StringDBusMethodCallback& callback) = 0; | 120 const StringDBusMethodCallback& callback) = 0; |
117 | 121 |
118 // Same as GetSanitizedUsername() but blocks until a reply is received, and | 122 // Same as GetSanitizedUsername() but blocks until a reply is received, and |
119 // returns the sanitized username synchronously. Returns an empty string if | 123 // returns the sanitized username synchronously. Returns an empty string if |
120 // the method call fails. | 124 // the method call fails. |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // Create() should be used instead. | 417 // Create() should be used instead. |
414 CryptohomeClient(); | 418 CryptohomeClient(); |
415 | 419 |
416 private: | 420 private: |
417 DISALLOW_COPY_AND_ASSIGN(CryptohomeClient); | 421 DISALLOW_COPY_AND_ASSIGN(CryptohomeClient); |
418 }; | 422 }; |
419 | 423 |
420 } // namespace chromeos | 424 } // namespace chromeos |
421 | 425 |
422 #endif // CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ | 426 #endif // CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ |
OLD | NEW |