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 #include "net/cert/nss_cert_database.h" | 5 #include "net/cert/nss_cert_database.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <certdb.h> | 8 #include <certdb.h> |
9 #include <keyhi.h> | 9 #include <keyhi.h> |
10 #include <pk11pub.h> | 10 #include <pk11pub.h> |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 NotifyObserversOfCertRemoved(cert); | 311 NotifyObserversOfCertRemoved(cert); |
312 | 312 |
313 return true; | 313 return true; |
314 } | 314 } |
315 | 315 |
316 bool NSSCertDatabase::IsReadOnly(const X509Certificate* cert) const { | 316 bool NSSCertDatabase::IsReadOnly(const X509Certificate* cert) const { |
317 PK11SlotInfo* slot = cert->os_cert_handle()->slot; | 317 PK11SlotInfo* slot = cert->os_cert_handle()->slot; |
318 return slot && PK11_IsReadOnly(slot); | 318 return slot && PK11_IsReadOnly(slot); |
319 } | 319 } |
320 | 320 |
| 321 bool NSSCertDatabase::IsHardwareBacked(const X509Certificate* cert) const { |
| 322 PK11SlotInfo* slot = cert->os_cert_handle()->slot; |
| 323 return slot && PK11_IsHW(slot); |
| 324 } |
| 325 |
321 void NSSCertDatabase::AddObserver(Observer* observer) { | 326 void NSSCertDatabase::AddObserver(Observer* observer) { |
322 observer_list_->AddObserver(observer); | 327 observer_list_->AddObserver(observer); |
323 } | 328 } |
324 | 329 |
325 void NSSCertDatabase::RemoveObserver(Observer* observer) { | 330 void NSSCertDatabase::RemoveObserver(Observer* observer) { |
326 observer_list_->RemoveObserver(observer); | 331 observer_list_->RemoveObserver(observer); |
327 } | 332 } |
328 | 333 |
329 void NSSCertDatabase::NotifyObserversOfCertAdded(const X509Certificate* cert) { | 334 void NSSCertDatabase::NotifyObserversOfCertAdded(const X509Certificate* cert) { |
330 observer_list_->Notify(&Observer::OnCertAdded, make_scoped_refptr(cert)); | 335 observer_list_->Notify(&Observer::OnCertAdded, make_scoped_refptr(cert)); |
331 } | 336 } |
332 | 337 |
333 void NSSCertDatabase::NotifyObserversOfCertRemoved( | 338 void NSSCertDatabase::NotifyObserversOfCertRemoved( |
334 const X509Certificate* cert) { | 339 const X509Certificate* cert) { |
335 observer_list_->Notify(&Observer::OnCertRemoved, make_scoped_refptr(cert)); | 340 observer_list_->Notify(&Observer::OnCertRemoved, make_scoped_refptr(cert)); |
336 } | 341 } |
337 | 342 |
338 void NSSCertDatabase::NotifyObserversOfCACertChanged( | 343 void NSSCertDatabase::NotifyObserversOfCACertChanged( |
339 const X509Certificate* cert) { | 344 const X509Certificate* cert) { |
340 observer_list_->Notify( | 345 observer_list_->Notify( |
341 &Observer::OnCACertChanged, make_scoped_refptr(cert)); | 346 &Observer::OnCACertChanged, make_scoped_refptr(cert)); |
342 } | 347 } |
343 | 348 |
344 } // namespace net | 349 } // namespace net |
OLD | NEW |