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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const DataCallback& callback) = 0; | 91 const DataCallback& callback) = 0; |
92 | 92 |
93 // Asks cryptohomed to asynchronously finish an attestation enrollment. | 93 // Asks cryptohomed to asynchronously finish an attestation enrollment. |
94 // |pca_response| is the response to the enrollment request emitted by the | 94 // |pca_response| is the response to the enrollment request emitted by the |
95 // Privacy CA. | 95 // Privacy CA. |
96 virtual void AsyncTpmAttestationEnroll(const std::string& pca_response, | 96 virtual void AsyncTpmAttestationEnroll(const std::string& pca_response, |
97 const Callback& callback) = 0; | 97 const Callback& callback) = 0; |
98 | 98 |
99 // Asks cryptohomed to asynchronously create an attestation certificate | 99 // Asks cryptohomed to asynchronously create an attestation certificate |
100 // request according to |options|, which is a combination of | 100 // request according to |options|, which is a combination of |
101 // CryptohomeClient::AttestationCertificateOptions. On success the data sent | 101 // attestation::AttestationCertificateOptions. On success the data sent to |
102 // to |callback| is a request to be sent to the Privacy CA. | 102 // |callback| is a request to be sent to the Privacy CA. |
103 virtual void AsyncTpmAttestationCreateCertRequest( | 103 virtual void AsyncTpmAttestationCreateCertRequest( |
104 int options, | 104 int options, |
105 const DataCallback& callback) = 0; | 105 const DataCallback& callback) = 0; |
106 | 106 |
107 // Asks cryptohomed to asynchronously finish an attestation certificate | 107 // Asks cryptohomed to asynchronously finish an attestation certificate |
108 // request. On success the data sent to |callback| is a certificate chain | 108 // request. On success the data sent to |callback| is a certificate chain |
109 // in PEM format. |pca_response| is the response to the certificate request | 109 // in PEM format. |pca_response| is the response to the certificate request |
110 // emitted by the Privacy CA. |key_type| determines whether the certified key | 110 // emitted by the Privacy CA. |key_type| determines whether the certified key |
111 // is to be associated with the current user. |key_name| is a name for the | 111 // is to be associated with the current user. |key_name| is a name for the |
112 // key. | 112 // key. |
113 virtual void AsyncTpmAttestationFinishCertRequest( | 113 virtual void AsyncTpmAttestationFinishCertRequest( |
114 const std::string& pca_response, | 114 const std::string& pca_response, |
115 chromeos::CryptohomeClient::AttestationKeyType key_type, | 115 chromeos::attestation::AttestationKeyType key_type, |
116 const std::string& key_name, | 116 const std::string& key_name, |
117 const DataCallback& callback) = 0; | 117 const DataCallback& callback) = 0; |
118 | 118 |
119 // Asks cryptohomed to asynchronously register the attestation key specified | 119 // Asks cryptohomed to asynchronously register the attestation key specified |
120 // by |key_type| and |key_name|. | 120 // by |key_type| and |key_name|. |
121 virtual void TpmAttestationRegisterKey( | 121 virtual void TpmAttestationRegisterKey( |
122 chromeos::CryptohomeClient::AttestationKeyType key_type, | 122 chromeos::attestation::AttestationKeyType key_type, |
123 const std::string& key_name, | 123 const std::string& key_name, |
124 const Callback& callback) = 0; | 124 const Callback& callback) = 0; |
125 | 125 |
126 // Asks cryptohomed to asynchronously sign an enterprise challenge with the | 126 // Asks cryptohomed to asynchronously sign an enterprise challenge with the |
127 // key specified by |key_type| and |key_name|. The |domain| and |device_id| | 127 // key specified by |key_type| and |key_name|. The |domain| and |device_id| |
128 // parameters will be included in the challenge response. |challenge| must be | 128 // parameters will be included in the challenge response. |challenge| must be |
129 // a valid enterprise challenge. On success, the data sent to |callback| is | 129 // a valid enterprise challenge. On success, the data sent to |callback| is |
130 // the challenge response. | 130 // the challenge response. |
131 virtual void TpmAttestationSignEnterpriseChallenge( | 131 virtual void TpmAttestationSignEnterpriseChallenge( |
132 chromeos::CryptohomeClient::AttestationKeyType key_type, | 132 chromeos::attestation::AttestationKeyType key_type, |
133 const std::string& key_name, | 133 const std::string& key_name, |
134 const std::string& domain, | 134 const std::string& domain, |
135 const std::string& device_id, | 135 const std::string& device_id, |
136 chromeos::CryptohomeClient::AttestationChallengeOptions options, | 136 chromeos::attestation::AttestationChallengeOptions options, |
137 const std::string& challenge, | 137 const std::string& challenge, |
138 const DataCallback& callback) = 0; | 138 const DataCallback& callback) = 0; |
139 | 139 |
140 // Asks cryptohomed to asynchronously sign a simple challenge with the key | 140 // Asks cryptohomed to asynchronously sign a simple challenge with the key |
141 // specified by |key_type| and |key_name|. |challenge| can be any arbitrary | 141 // specified by |key_type| and |key_name|. |challenge| can be any arbitrary |
142 // set of bytes. On success, the data sent to |callback| is the challenge | 142 // set of bytes. On success, the data sent to |callback| is the challenge |
143 // response. | 143 // response. |
144 virtual void TpmAttestationSignSimpleChallenge( | 144 virtual void TpmAttestationSignSimpleChallenge( |
145 chromeos::CryptohomeClient::AttestationKeyType key_type, | 145 chromeos::attestation::AttestationKeyType key_type, |
146 const std::string& key_name, | 146 const std::string& key_name, |
147 const std::string& challenge, | 147 const std::string& challenge, |
148 const DataCallback& callback) = 0; | 148 const DataCallback& callback) = 0; |
149 | 149 |
150 // Asks cryptohome to asynchronously retrieve a string associated with given | 150 // Asks cryptohome to asynchronously retrieve a string associated with given |
151 // |user| that would be used in mount path instead of |user|. | 151 // |user| that would be used in mount path instead of |user|. |
152 // On success the data is sent to |callback|. | 152 // On success the data is sent to |callback|. |
153 virtual void AsyncGetSanitizedUsername( | 153 virtual void AsyncGetSanitizedUsername( |
154 const std::string& user, | 154 const std::string& user, |
155 const DataCallback& callback) = 0; | 155 const DataCallback& callback) = 0; |
(...skipping 11 matching lines...) Expand all Loading... |
167 static void Shutdown(); | 167 static void Shutdown(); |
168 | 168 |
169 // Returns a pointer to the global AsyncMethodCaller instance. | 169 // Returns a pointer to the global AsyncMethodCaller instance. |
170 // Initialize() should already have been called. | 170 // Initialize() should already have been called. |
171 static AsyncMethodCaller* GetInstance(); | 171 static AsyncMethodCaller* GetInstance(); |
172 }; | 172 }; |
173 | 173 |
174 } // namespace cryptohome | 174 } // namespace cryptohome |
175 | 175 |
176 #endif // CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ | 176 #endif // CHROMEOS_CRYPTOHOME_ASYNC_METHOD_CALLER_H_ |
OLD | NEW |