| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class Delegate { | 21 class Delegate { |
| 22 public: | 22 public: |
| 23 // This will be called back on the UI thread. Consult |return_code| for | 23 // This will be called back on the UI thread. Consult |return_code| for |
| 24 // further information beyond mere success or failure. | 24 // further information beyond mere success or failure. |
| 25 virtual void OnComplete(bool success, int return_code) = 0; | 25 virtual void OnComplete(bool success, int return_code) = 0; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 CryptohomeLibrary(); | 28 CryptohomeLibrary(); |
| 29 virtual ~CryptohomeLibrary(); | 29 virtual ~CryptohomeLibrary(); |
| 30 | 30 |
| 31 virtual void Init() = 0; |
| 32 |
| 31 // Asks cryptohomed to try to find the cryptohome for |user_email| and then | 33 // Asks cryptohomed to try to find the cryptohome for |user_email| and then |
| 32 // use |passhash| to unlock the key. | 34 // use |passhash| to unlock the key. |
| 33 virtual bool CheckKey(const std::string& user_email, | 35 virtual bool CheckKey(const std::string& user_email, |
| 34 const std::string& passhash) = 0; | 36 const std::string& passhash) = 0; |
| 35 | 37 |
| 36 // Asks cryptohomed to asynchronously try to find the cryptohome for | 38 // Asks cryptohomed to asynchronously try to find the cryptohome for |
| 37 // |user_email| and then use |passhash| to unlock the key. | 39 // |user_email| and then use |passhash| to unlock the key. |
| 38 // Returns true if the attempt is successfully initiated. | 40 // Returns true if the attempt is successfully initiated. |
| 39 // d->OnComplete() will be called with status info on completion. | 41 // d->OnComplete() will be called with status info on completion. |
| 40 virtual bool AsyncCheckKey(const std::string& user_email, | 42 virtual bool AsyncCheckKey(const std::string& user_email, |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 virtual bool Pkcs11IsTpmTokenReady() = 0; | 163 virtual bool Pkcs11IsTpmTokenReady() = 0; |
| 162 | 164 |
| 163 // Factory function, creates a new instance and returns ownership. | 165 // Factory function, creates a new instance and returns ownership. |
| 164 // For normal usage, access the singleton via CrosLibrary::Get(). | 166 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 165 static CryptohomeLibrary* GetImpl(bool stub); | 167 static CryptohomeLibrary* GetImpl(bool stub); |
| 166 }; | 168 }; |
| 167 | 169 |
| 168 } // namespace chromeos | 170 } // namespace chromeos |
| 169 | 171 |
| 170 #endif // CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ | 172 #endif // CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
| OLD | NEW |