| 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/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 const std::string& request_origin, | 131 const std::string& request_origin, |
| 132 const DataCallback& callback) = 0; | 132 const DataCallback& callback) = 0; |
| 133 | 133 |
| 134 // Asks cryptohomed to asynchronously finish an attestation certificate | 134 // Asks cryptohomed to asynchronously finish an attestation certificate |
| 135 // request. On success the data sent to |callback| is a certificate chain | 135 // request. On success the data sent to |callback| is a certificate chain |
| 136 // in PEM format. |pca_response| is the response to the certificate request | 136 // in PEM format. |pca_response| is the response to the certificate request |
| 137 // emitted by the Privacy CA. |key_type| determines whether the certified key | 137 // emitted by the Privacy CA. |key_type| determines whether the certified key |
| 138 // is to be associated with the current user. |key_name| is a name for the | 138 // is to be associated with the current user. |key_name| is a name for the |
| 139 // key. If |key_type| is KEY_USER, a |user_id| must be provided. Otherwise | 139 // key. If |key_type| is KEY_USER, a |user_id| must be provided. Otherwise |
| 140 // |user_id| is ignored. For normal GAIA users the |user_id| is | 140 // |user_id| is ignored. For normal GAIA users the |user_id| is |
| 141 // a GaiaId-derived string (see AccountId::GetGaiaIdKey). | 141 // an AccountId-derived string (see AccountId::GetAccountIdKey). |
| 142 virtual void AsyncTpmAttestationFinishCertRequest( | 142 virtual void AsyncTpmAttestationFinishCertRequest( |
| 143 const std::string& pca_response, | 143 const std::string& pca_response, |
| 144 chromeos::attestation::AttestationKeyType key_type, | 144 chromeos::attestation::AttestationKeyType key_type, |
| 145 const Identification& user_id, | 145 const Identification& user_id, |
| 146 const std::string& key_name, | 146 const std::string& key_name, |
| 147 const DataCallback& callback) = 0; | 147 const DataCallback& callback) = 0; |
| 148 | 148 |
| 149 // Asks cryptohomed to asynchronously register the attestation key specified | 149 // Asks cryptohomed to asynchronously register the attestation key specified |
| 150 // by |key_type| and |key_name|. If |key_type| is KEY_USER, a |user_id| must | 150 // by |key_type| and |key_name|. If |key_type| is KEY_USER, a |user_id| must |
| 151 // be provided. Otherwise |user_id| is ignored. For normal GAIA users the | 151 // be provided. Otherwise |user_id| is ignored. For normal GAIA users the |
| 152 // |user_id| is a GaiaId-derived string (see AccountId::GetGaiaIdKey). | 152 // |user_id| is an AccountId-derived string (see AccountId::GetAccountIdKey). |
| 153 virtual void TpmAttestationRegisterKey( | 153 virtual void TpmAttestationRegisterKey( |
| 154 chromeos::attestation::AttestationKeyType key_type, | 154 chromeos::attestation::AttestationKeyType key_type, |
| 155 const Identification& user_id, | 155 const Identification& user_id, |
| 156 const std::string& key_name, | 156 const std::string& key_name, |
| 157 const Callback& callback) = 0; | 157 const Callback& callback) = 0; |
| 158 | 158 |
| 159 // Asks cryptohomed to asynchronously sign an enterprise challenge with the | 159 // Asks cryptohomed to asynchronously sign an enterprise challenge with the |
| 160 // key specified by |key_type| and |key_name|. The |domain| and |device_id| | 160 // key specified by |key_type| and |key_name|. The |domain| and |device_id| |
| 161 // parameters will be included in the challenge response. |challenge| must be | 161 // parameters will be included in the challenge response. |challenge| must be |
| 162 // a valid enterprise challenge. On success, the data sent to |callback| is | 162 // a valid enterprise challenge. On success, the data sent to |callback| is |
| 163 // the challenge response. If |key_type| is KEY_USER, a |user_id| must be | 163 // the challenge response. If |key_type| is KEY_USER, a |user_id| must be |
| 164 // provided. Otherwise |user_id| is ignored. For normal GAIA users the | 164 // provided. Otherwise |user_id| is ignored. For normal GAIA users the |
| 165 // |user_id| is a GaiaId-derived string (see AccountId::GetGaiaIdKey). | 165 // |user_id| is an AccountaId-derived string (see AccountId::GetAccountIdKey). |
| 166 virtual void TpmAttestationSignEnterpriseChallenge( | 166 virtual void TpmAttestationSignEnterpriseChallenge( |
| 167 chromeos::attestation::AttestationKeyType key_type, | 167 chromeos::attestation::AttestationKeyType key_type, |
| 168 const Identification& user_id, | 168 const Identification& user_id, |
| 169 const std::string& key_name, | 169 const std::string& key_name, |
| 170 const std::string& domain, | 170 const std::string& domain, |
| 171 const std::string& device_id, | 171 const std::string& device_id, |
| 172 chromeos::attestation::AttestationChallengeOptions options, | 172 chromeos::attestation::AttestationChallengeOptions options, |
| 173 const std::string& challenge, | 173 const std::string& challenge, |
| 174 const DataCallback& callback) = 0; | 174 const DataCallback& callback) = 0; |
| 175 | 175 |
| 176 // Asks cryptohomed to asynchronously sign a simple challenge with the key | 176 // Asks cryptohomed to asynchronously sign a simple challenge with the key |
| 177 // specified by |key_type| and |key_name|. |challenge| can be any arbitrary | 177 // specified by |key_type| and |key_name|. |challenge| can be any arbitrary |
| 178 // set of bytes. On success, the data sent to |callback| is the challenge | 178 // set of bytes. On success, the data sent to |callback| is the challenge |
| 179 // response. If |key_type| is KEY_USER, a |user_id| must be provided. | 179 // response. If |key_type| is KEY_USER, a |user_id| must be provided. |
| 180 // Otherwise |user_id| is ignored. For normal GAIA users the |user_id| is a | 180 // Otherwise |user_id| is ignored. For normal GAIA users the |user_id| is an |
| 181 // GaiaId-derived string (see AccountId::GetGaiaIdKey). | 181 // AccountId-derived string (see AccountId::GetAccountIdKey). |
| 182 virtual void TpmAttestationSignSimpleChallenge( | 182 virtual void TpmAttestationSignSimpleChallenge( |
| 183 chromeos::attestation::AttestationKeyType key_type, | 183 chromeos::attestation::AttestationKeyType key_type, |
| 184 const Identification& user_id, | 184 const Identification& user_id, |
| 185 const std::string& key_name, | 185 const std::string& key_name, |
| 186 const std::string& challenge, | 186 const std::string& challenge, |
| 187 const DataCallback& callback) = 0; | 187 const DataCallback& callback) = 0; |
| 188 | 188 |
| 189 // Asks cryptohome to asynchronously retrieve a string associated with given | 189 // Asks cryptohome to asynchronously retrieve a string associated with given |
| 190 // |user_id| that would be used in mount path instead of |user_id|. | 190 // |user_id| that would be used in mount path instead of |user_id|. |
| 191 // On success the data is sent to |callback|. | 191 // On success the data is sent to |callback|. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 205 static void Shutdown(); | 205 static void Shutdown(); |
| 206 | 206 |
| 207 // Returns a pointer to the global AsyncMethodCaller instance. | 207 // Returns a pointer to the global AsyncMethodCaller instance. |
| 208 // Initialize() should already have been called. | 208 // Initialize() should already have been called. |
| 209 static AsyncMethodCaller* GetInstance(); | 209 static AsyncMethodCaller* GetInstance(); |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 } // namespace cryptohome | 212 } // namespace cryptohome |
| 213 | 213 |
| 214 #endif // CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ | 214 #endif // CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ |
| OLD | NEW |