| 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" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 const DataCallback& callback) = 0; | 108 const DataCallback& callback) = 0; |
| 109 | 109 |
| 110 // Asks cryptohomed to asynchronously finish an attestation enrollment. | 110 // Asks cryptohomed to asynchronously finish an attestation enrollment. |
| 111 // |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 |
| 112 // Privacy CA. | 112 // Privacy CA. |
| 113 virtual void AsyncTpmAttestationEnroll(const std::string& pca_response, | 113 virtual void AsyncTpmAttestationEnroll(const std::string& pca_response, |
| 114 const Callback& callback) = 0; | 114 const Callback& callback) = 0; |
| 115 | 115 |
| 116 // Asks cryptohomed to asynchronously create an attestation certificate | 116 // Asks cryptohomed to asynchronously create an attestation certificate |
| 117 // request according to |certificate_profile|. Some profiles require that the | 117 // request according to |certificate_profile|. Some profiles require that the |
| 118 // |user_email| of the currently active user and an identifier of the | 118 // |user_id| of the currently active user and an identifier of the |
| 119 // |request_origin| be provided. On success the data sent to |callback| is a | 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 | 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. | 121 // the Privacy CA but the |user_id| will never be sent. |
| 122 virtual void AsyncTpmAttestationCreateCertRequest( | 122 virtual void AsyncTpmAttestationCreateCertRequest( |
| 123 chromeos::attestation::AttestationCertificateProfile certificate_profile, | 123 chromeos::attestation::AttestationCertificateProfile certificate_profile, |
| 124 const std::string& user_email, | 124 const std::string& user_id, |
| 125 const std::string& request_origin, | 125 const std::string& request_origin, |
| 126 const DataCallback& callback) = 0; | 126 const DataCallback& callback) = 0; |
| 127 | 127 |
| 128 // Asks cryptohomed to asynchronously finish an attestation certificate | 128 // Asks cryptohomed to asynchronously finish an attestation certificate |
| 129 // 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 |
| 130 // 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 |
| 131 // 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 |
| 132 // 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 |
| 133 // key. | 133 // key. If |key_type| is KEY_USER, a |user_id| must be provided. Otherwise |
| 134 // |user_id| is ignored. For normal GAIA users the |user_id| is a canonical |
| 135 // email address. |
| 134 virtual void AsyncTpmAttestationFinishCertRequest( | 136 virtual void AsyncTpmAttestationFinishCertRequest( |
| 135 const std::string& pca_response, | 137 const std::string& pca_response, |
| 136 chromeos::attestation::AttestationKeyType key_type, | 138 chromeos::attestation::AttestationKeyType key_type, |
| 139 const std::string& user_id, |
| 137 const std::string& key_name, | 140 const std::string& key_name, |
| 138 const DataCallback& callback) = 0; | 141 const DataCallback& callback) = 0; |
| 139 | 142 |
| 140 // Asks cryptohomed to asynchronously register the attestation key specified | 143 // Asks cryptohomed to asynchronously register the attestation key specified |
| 141 // by |key_type| and |key_name|. | 144 // by |key_type| and |key_name|. If |key_type| is KEY_USER, a |user_id| must |
| 145 // be provided. Otherwise |user_id| is ignored. For normal GAIA users the |
| 146 // |user_id| is a canonical email address. |
| 142 virtual void TpmAttestationRegisterKey( | 147 virtual void TpmAttestationRegisterKey( |
| 143 chromeos::attestation::AttestationKeyType key_type, | 148 chromeos::attestation::AttestationKeyType key_type, |
| 149 const std::string& user_id, |
| 144 const std::string& key_name, | 150 const std::string& key_name, |
| 145 const Callback& callback) = 0; | 151 const Callback& callback) = 0; |
| 146 | 152 |
| 147 // Asks cryptohomed to asynchronously sign an enterprise challenge with the | 153 // Asks cryptohomed to asynchronously sign an enterprise challenge with the |
| 148 // key specified by |key_type| and |key_name|. The |domain| and |device_id| | 154 // key specified by |key_type| and |key_name|. The |domain| and |device_id| |
| 149 // parameters will be included in the challenge response. |challenge| must be | 155 // parameters will be included in the challenge response. |challenge| must be |
| 150 // a valid enterprise challenge. On success, the data sent to |callback| is | 156 // a valid enterprise challenge. On success, the data sent to |callback| is |
| 151 // the challenge response. | 157 // the challenge response. If |key_type| is KEY_USER, a |user_id| must be |
| 158 // provided. Otherwise |user_id| is ignored. For normal GAIA users the |
| 159 // |user_id| is a canonical email address. |
| 152 virtual void TpmAttestationSignEnterpriseChallenge( | 160 virtual void TpmAttestationSignEnterpriseChallenge( |
| 153 chromeos::attestation::AttestationKeyType key_type, | 161 chromeos::attestation::AttestationKeyType key_type, |
| 162 const std::string& user_id, |
| 154 const std::string& key_name, | 163 const std::string& key_name, |
| 155 const std::string& domain, | 164 const std::string& domain, |
| 156 const std::string& device_id, | 165 const std::string& device_id, |
| 157 chromeos::attestation::AttestationChallengeOptions options, | 166 chromeos::attestation::AttestationChallengeOptions options, |
| 158 const std::string& challenge, | 167 const std::string& challenge, |
| 159 const DataCallback& callback) = 0; | 168 const DataCallback& callback) = 0; |
| 160 | 169 |
| 161 // Asks cryptohomed to asynchronously sign a simple challenge with the key | 170 // Asks cryptohomed to asynchronously sign a simple challenge with the key |
| 162 // specified by |key_type| and |key_name|. |challenge| can be any arbitrary | 171 // specified by |key_type| and |key_name|. |challenge| can be any arbitrary |
| 163 // set of bytes. On success, the data sent to |callback| is the challenge | 172 // set of bytes. On success, the data sent to |callback| is the challenge |
| 164 // response. | 173 // response. If |key_type| is KEY_USER, a |user_id| must be provided. |
| 174 // Otherwise |user_id| is ignored. For normal GAIA users the |user_id| is a |
| 175 // canonical email address. |
| 165 virtual void TpmAttestationSignSimpleChallenge( | 176 virtual void TpmAttestationSignSimpleChallenge( |
| 166 chromeos::attestation::AttestationKeyType key_type, | 177 chromeos::attestation::AttestationKeyType key_type, |
| 178 const std::string& user_id, |
| 167 const std::string& key_name, | 179 const std::string& key_name, |
| 168 const std::string& challenge, | 180 const std::string& challenge, |
| 169 const DataCallback& callback) = 0; | 181 const DataCallback& callback) = 0; |
| 170 | 182 |
| 171 // Asks cryptohome to asynchronously retrieve a string associated with given | 183 // Asks cryptohome to asynchronously retrieve a string associated with given |
| 172 // |user| that would be used in mount path instead of |user|. | 184 // |user| that would be used in mount path instead of |user|. |
| 173 // On success the data is sent to |callback|. | 185 // On success the data is sent to |callback|. |
| 174 virtual void AsyncGetSanitizedUsername( | 186 virtual void AsyncGetSanitizedUsername( |
| 175 const std::string& user, | 187 const std::string& user, |
| 176 const DataCallback& callback) = 0; | 188 const DataCallback& callback) = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 188 static void Shutdown(); | 200 static void Shutdown(); |
| 189 | 201 |
| 190 // Returns a pointer to the global AsyncMethodCaller instance. | 202 // Returns a pointer to the global AsyncMethodCaller instance. |
| 191 // Initialize() should already have been called. | 203 // Initialize() should already have been called. |
| 192 static AsyncMethodCaller* GetInstance(); | 204 static AsyncMethodCaller* GetInstance(); |
| 193 }; | 205 }; |
| 194 | 206 |
| 195 } // namespace cryptohome | 207 } // namespace cryptohome |
| 196 | 208 |
| 197 #endif // CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ | 209 #endif // CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ |
| OLD | NEW |