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_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ | 5 #ifndef CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ |
6 #define CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ | 6 #define CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "chromeos/attestation/attestation_constants.h" |
12 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
13 #include "chromeos/dbus/cryptohome_client.h" | 14 #include "chromeos/dbus/cryptohome_client.h" |
14 #include "third_party/cros_system_api/dbus/service_constants.h" | 15 #include "third_party/cros_system_api/dbus/service_constants.h" |
15 | 16 |
16 namespace cryptohome { | 17 namespace cryptohome { |
17 | 18 |
18 // Note: This file is placed in ::cryptohome instead of ::chromeos::cryptohome | 19 // Note: This file is placed in ::cryptohome instead of ::chromeos::cryptohome |
19 // since there is already a namespace ::cryptohome which holds the error code | 20 // since there is already a namespace ::cryptohome which holds the error code |
20 // enum (MountError) and referencing ::chromeos::cryptohome and ::cryptohome | 21 // enum (MountError) and referencing ::chromeos::cryptohome and ::cryptohome |
21 // within the same code is confusing. | 22 // within the same code is confusing. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 virtual void AsyncTpmAttestationCreateEnrollRequest( | 107 virtual void AsyncTpmAttestationCreateEnrollRequest( |
107 const DataCallback& callback) = 0; | 108 const DataCallback& callback) = 0; |
108 | 109 |
109 // Asks cryptohomed to asynchronously finish an attestation enrollment. | 110 // Asks cryptohomed to asynchronously finish an attestation enrollment. |
110 // |pca_response| is the response to the enrollment request emitted by the | 111 // |pca_response| is the response to the enrollment request emitted by the |
111 // Privacy CA. | 112 // Privacy CA. |
112 virtual void AsyncTpmAttestationEnroll(const std::string& pca_response, | 113 virtual void AsyncTpmAttestationEnroll(const std::string& pca_response, |
113 const Callback& callback) = 0; | 114 const Callback& callback) = 0; |
114 | 115 |
115 // Asks cryptohomed to asynchronously create an attestation certificate | 116 // Asks cryptohomed to asynchronously create an attestation certificate |
116 // request according to |options|, which is a combination of | 117 // request according to |certificate_profile|. Some profiles require that the |
117 // attestation::AttestationCertificateOptions. On success the data sent to | 118 // |user_email| of the currently active user and an identifier of the |
118 // |callback| is a request to be sent to the Privacy CA. | 119 // |request_origin| be provided. On success the data sent to |callback| is a |
| 120 // request to be sent to the Privacy CA. The |request_origin| may be sent to |
| 121 // the Privacy CA but the |user_email| will never be sent. |
119 virtual void AsyncTpmAttestationCreateCertRequest( | 122 virtual void AsyncTpmAttestationCreateCertRequest( |
120 int options, | 123 chromeos::attestation::AttestationCertificateProfile certificate_profile, |
| 124 const std::string& user_email, |
| 125 const std::string& request_origin, |
121 const DataCallback& callback) = 0; | 126 const DataCallback& callback) = 0; |
122 | 127 |
123 // Asks cryptohomed to asynchronously finish an attestation certificate | 128 // Asks cryptohomed to asynchronously finish an attestation certificate |
124 // request. On success the data sent to |callback| is a certificate chain | 129 // request. On success the data sent to |callback| is a certificate chain |
125 // in PEM format. |pca_response| is the response to the certificate request | 130 // in PEM format. |pca_response| is the response to the certificate request |
126 // emitted by the Privacy CA. |key_type| determines whether the certified key | 131 // emitted by the Privacy CA. |key_type| determines whether the certified key |
127 // is to be associated with the current user. |key_name| is a name for the | 132 // is to be associated with the current user. |key_name| is a name for the |
128 // key. | 133 // key. |
129 virtual void AsyncTpmAttestationFinishCertRequest( | 134 virtual void AsyncTpmAttestationFinishCertRequest( |
130 const std::string& pca_response, | 135 const std::string& pca_response, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 static void Shutdown(); | 188 static void Shutdown(); |
184 | 189 |
185 // Returns a pointer to the global AsyncMethodCaller instance. | 190 // Returns a pointer to the global AsyncMethodCaller instance. |
186 // Initialize() should already have been called. | 191 // Initialize() should already have been called. |
187 static AsyncMethodCaller* GetInstance(); | 192 static AsyncMethodCaller* GetInstance(); |
188 }; | 193 }; |
189 | 194 |
190 } // namespace cryptohome | 195 } // namespace cryptohome |
191 | 196 |
192 #endif // CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ | 197 #endif // CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ |
OLD | NEW |