OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_NETWORK_CERT_LOADER_H_ | 5 #ifndef CHROMEOS_NETWORK_CERT_LOADER_H_ |
6 #define CHROMEOS_NETWORK_CERT_LOADER_H_ | 6 #define CHROMEOS_NETWORK_CERT_LOADER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 void AddObserver(CertLoader::Observer* observer); | 58 void AddObserver(CertLoader::Observer* observer); |
59 void RemoveObserver(CertLoader::Observer* observer); | 59 void RemoveObserver(CertLoader::Observer* observer); |
60 | 60 |
61 // Returns true when the certificate list has been requested but not loaded. | 61 // Returns true when the certificate list has been requested but not loaded. |
62 bool CertificatesLoading() const; | 62 bool CertificatesLoading() const; |
63 | 63 |
64 // Returns true if the TPM is available for hardware-backed certificates. | 64 // Returns true if the TPM is available for hardware-backed certificates. |
65 bool IsHardwareBacked() const; | 65 bool IsHardwareBacked() const; |
66 | 66 |
| 67 std::string GetPkcs11IdForCert(const net::X509Certificate& cert) const; |
| 68 |
67 bool certificates_loaded() const { return certificates_loaded_; } | 69 bool certificates_loaded() const { return certificates_loaded_; } |
68 | 70 |
69 // TPM info is only valid once the TPM is available (IsHardwareBacked is | 71 // TPM info is only valid once the TPM is available (IsHardwareBacked is |
70 // true). Otherwise empty strings will be returned. | 72 // true). Otherwise empty strings will be returned. |
71 const std::string& tpm_token_name() const { return tpm_token_name_; } | 73 const std::string& tpm_token_name() const { return tpm_token_name_; } |
72 const std::string& tpm_token_slot() const { return tpm_token_slot_; } | 74 const std::string& tpm_token_slot() const { return tpm_token_slot_; } |
73 const std::string& tpm_user_pin() const { return tpm_user_pin_; } | 75 const std::string& tpm_user_pin() const { return tpm_user_pin_; } |
74 | 76 |
75 // This will be empty until certificates_loaded() is true. | 77 // This will be empty until certificates_loaded() is true. |
76 const net::CertificateList& cert_list() const { return cert_list_; } | 78 const net::CertificateList& cert_list() const { return cert_list_; } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 132 |
131 // TODO(stevenjb): Use multiple factories to track callback chains. | 133 // TODO(stevenjb): Use multiple factories to track callback chains. |
132 base::WeakPtrFactory<CertLoader> weak_ptr_factory_; | 134 base::WeakPtrFactory<CertLoader> weak_ptr_factory_; |
133 | 135 |
134 DISALLOW_COPY_AND_ASSIGN(CertLoader); | 136 DISALLOW_COPY_AND_ASSIGN(CertLoader); |
135 }; | 137 }; |
136 | 138 |
137 } // namespace chromeos | 139 } // namespace chromeos |
138 | 140 |
139 #endif // CHROMEOS_NETWORK_CERT_LOADER_H_ | 141 #endif // CHROMEOS_NETWORK_CERT_LOADER_H_ |
OLD | NEW |