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 <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/basictypes.h" | |
12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" |
13 #include "chromeos/attestation/attestation_constants.h" | 15 #include "chromeos/attestation/attestation_constants.h" |
14 #include "chromeos/chromeos_export.h" | 16 #include "chromeos/chromeos_export.h" |
15 #include "chromeos/dbus/dbus_client.h" | 17 #include "chromeos/dbus/dbus_client.h" |
16 #include "chromeos/dbus/dbus_method_call_status.h" | 18 #include "chromeos/dbus/dbus_method_call_status.h" |
17 | 19 |
18 namespace cryptohome { | 20 namespace cryptohome { |
19 | 21 |
20 class AccountIdentifier; | 22 class AccountIdentifier; |
21 class AddKeyRequest; | 23 class AddKeyRequest; |
22 class AuthorizationRequest; | 24 class AuthorizationRequest; |
(...skipping 26 matching lines...) Expand all Loading... |
49 int return_code)> | 51 int return_code)> |
50 AsyncCallStatusHandler; | 52 AsyncCallStatusHandler; |
51 // A callback to handle AsyncCallStatusWithData signals. | 53 // A callback to handle AsyncCallStatusWithData signals. |
52 typedef base::Callback<void(int async_id, | 54 typedef base::Callback<void(int async_id, |
53 bool return_status, | 55 bool return_status, |
54 const std::string& data)> | 56 const std::string& data)> |
55 AsyncCallStatusWithDataHandler; | 57 AsyncCallStatusWithDataHandler; |
56 // A callback to handle responses of AsyncXXX methods. | 58 // A callback to handle responses of AsyncXXX methods. |
57 typedef base::Callback<void(int async_id)> AsyncMethodCallback; | 59 typedef base::Callback<void(int async_id)> AsyncMethodCallback; |
58 // A callback for GetSystemSalt(). | 60 // A callback for GetSystemSalt(). |
59 typedef base::Callback<void( | 61 typedef base::Callback<void(DBusMethodCallStatus call_status, |
60 DBusMethodCallStatus call_status, | 62 const std::vector<uint8_t>& system_salt)> |
61 const std::vector<uint8>& system_salt)> GetSystemSaltCallback; | 63 GetSystemSaltCallback; |
62 // A callback for WaitForServiceToBeAvailable(). | 64 // A callback for WaitForServiceToBeAvailable(). |
63 typedef base::Callback<void(bool service_is_ready)> | 65 typedef base::Callback<void(bool service_is_ready)> |
64 WaitForServiceToBeAvailableCallback; | 66 WaitForServiceToBeAvailableCallback; |
65 // A callback to handle responses of Pkcs11GetTpmTokenInfo method. The result | 67 // A callback to handle responses of Pkcs11GetTpmTokenInfo method. The result |
66 // of the D-Bus call is in |call_status|. On success, |label| holds the | 68 // of the D-Bus call is in |call_status|. On success, |label| holds the |
67 // PKCS #11 token label. This is not useful in practice to identify a token | 69 // PKCS #11 token label. This is not useful in practice to identify a token |
68 // but may be meaningful to a user. The |user_pin| can be used with the | 70 // but may be meaningful to a user. The |user_pin| can be used with the |
69 // C_Login PKCS #11 function but is not necessary because tokens are logged in | 71 // C_Login PKCS #11 function but is not necessary because tokens are logged in |
70 // for the duration of a signed-in session. The |slot| corresponds to a | 72 // for the duration of a signed-in session. The |slot| corresponds to a |
71 // CK_SLOT_ID for the PKCS #11 API and reliably identifies the token for the | 73 // CK_SLOT_ID for the PKCS #11 API and reliably identifies the token for the |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // The |user_email| must be a canonical email address as returned by | 245 // The |user_email| must be a canonical email address as returned by |
244 // user_manager::User::email(). | 246 // user_manager::User::email(). |
245 virtual void Pkcs11GetTpmTokenInfoForUser( | 247 virtual void Pkcs11GetTpmTokenInfoForUser( |
246 const std::string& user_email, | 248 const std::string& user_email, |
247 const Pkcs11GetTpmTokenInfoCallback& callback) = 0; | 249 const Pkcs11GetTpmTokenInfoCallback& callback) = 0; |
248 | 250 |
249 // Calls InstallAttributesGet method and returns true when the call succeeds. | 251 // Calls InstallAttributesGet method and returns true when the call succeeds. |
250 // This method blocks until the call returns. | 252 // This method blocks until the call returns. |
251 // The original content of |value| is lost. | 253 // The original content of |value| is lost. |
252 virtual bool InstallAttributesGet(const std::string& name, | 254 virtual bool InstallAttributesGet(const std::string& name, |
253 std::vector<uint8>* value, | 255 std::vector<uint8_t>* value, |
254 bool* successful) = 0; | 256 bool* successful) = 0; |
255 | 257 |
256 // Calls InstallAttributesSet method and returns true when the call succeeds. | 258 // Calls InstallAttributesSet method and returns true when the call succeeds. |
257 // This method blocks until the call returns. | 259 // This method blocks until the call returns. |
258 virtual bool InstallAttributesSet(const std::string& name, | 260 virtual bool InstallAttributesSet(const std::string& name, |
259 const std::vector<uint8>& value, | 261 const std::vector<uint8_t>& value, |
260 bool* successful) = 0; | 262 bool* successful) = 0; |
261 | 263 |
262 // Calls InstallAttributesFinalize method and returns true when the call | 264 // Calls InstallAttributesFinalize method and returns true when the call |
263 // succeeds. This method blocks until the call returns. | 265 // succeeds. This method blocks until the call returns. |
264 virtual bool InstallAttributesFinalize(bool* successful) = 0; | 266 virtual bool InstallAttributesFinalize(bool* successful) = 0; |
265 | 267 |
266 // Calls InstallAttributesIsReady method. | 268 // Calls InstallAttributesIsReady method. |
267 virtual void InstallAttributesIsReady( | 269 virtual void InstallAttributesIsReady( |
268 const BoolDBusMethodCallback& callback) = 0; | 270 const BoolDBusMethodCallback& callback) = 0; |
269 | 271 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 // Create() should be used instead. | 548 // Create() should be used instead. |
547 CryptohomeClient(); | 549 CryptohomeClient(); |
548 | 550 |
549 private: | 551 private: |
550 DISALLOW_COPY_AND_ASSIGN(CryptohomeClient); | 552 DISALLOW_COPY_AND_ASSIGN(CryptohomeClient); |
551 }; | 553 }; |
552 | 554 |
553 } // namespace chromeos | 555 } // namespace chromeos |
554 | 556 |
555 #endif // CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ | 557 #endif // CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ |
OLD | NEW |