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 NET_CERT_NSS_CERT_DATABASE_H_ | 5 #ifndef NET_CERT_NSS_CERT_DATABASE_H_ |
6 #define NET_CERT_NSS_CERT_DATABASE_H_ | 6 #define NET_CERT_NSS_CERT_DATABASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 TrustBits trust_bits); | 171 TrustBits trust_bits); |
172 | 172 |
173 // Delete certificate and associated private key (if one exists). | 173 // Delete certificate and associated private key (if one exists). |
174 // |cert| is still valid when this function returns. Returns true on | 174 // |cert| is still valid when this function returns. Returns true on |
175 // success. | 175 // success. |
176 bool DeleteCertAndKey(const X509Certificate* cert); | 176 bool DeleteCertAndKey(const X509Certificate* cert); |
177 | 177 |
178 // Check whether cert is stored in a readonly slot. | 178 // Check whether cert is stored in a readonly slot. |
179 bool IsReadOnly(const X509Certificate* cert) const; | 179 bool IsReadOnly(const X509Certificate* cert) const; |
180 | 180 |
| 181 // Check whether cert is stored in a hardware slot. |
| 182 bool IsHardwareBacked(const X509Certificate* cert) const; |
| 183 |
181 // Registers |observer| to receive notifications of certificate changes. The | 184 // Registers |observer| to receive notifications of certificate changes. The |
182 // thread on which this is called is the thread on which |observer| will be | 185 // thread on which this is called is the thread on which |observer| will be |
183 // called back with notifications. | 186 // called back with notifications. |
184 void AddObserver(Observer* observer); | 187 void AddObserver(Observer* observer); |
185 | 188 |
186 // Unregisters |observer| from receiving notifications. This must be called | 189 // Unregisters |observer| from receiving notifications. This must be called |
187 // on the same thread on which AddObserver() was called. | 190 // on the same thread on which AddObserver() was called. |
188 void RemoveObserver(Observer* observer); | 191 void RemoveObserver(Observer* observer); |
189 | 192 |
190 private: | 193 private: |
191 friend struct DefaultSingletonTraits<NSSCertDatabase>; | 194 friend struct DefaultSingletonTraits<NSSCertDatabase>; |
192 | 195 |
193 NSSCertDatabase(); | 196 NSSCertDatabase(); |
194 ~NSSCertDatabase(); | 197 ~NSSCertDatabase(); |
195 | 198 |
196 // Broadcasts notifications to all registered observers. | 199 // Broadcasts notifications to all registered observers. |
197 void NotifyObserversOfCertAdded(const X509Certificate* cert); | 200 void NotifyObserversOfCertAdded(const X509Certificate* cert); |
198 void NotifyObserversOfCertRemoved(const X509Certificate* cert); | 201 void NotifyObserversOfCertRemoved(const X509Certificate* cert); |
199 void NotifyObserversOfCACertChanged(const X509Certificate* cert); | 202 void NotifyObserversOfCACertChanged(const X509Certificate* cert); |
200 | 203 |
201 const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; | 204 const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; |
202 | 205 |
203 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); | 206 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); |
204 }; | 207 }; |
205 | 208 |
206 } // namespace net | 209 } // namespace net |
207 | 210 |
208 #endif // NET_CERT_NSS_CERT_DATABASE_H_ | 211 #endif // NET_CERT_NSS_CERT_DATABASE_H_ |
OLD | NEW |