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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 virtual void ListCerts(const ListCertsCallback& callback); | 123 virtual void ListCerts(const ListCertsCallback& callback); |
124 | 124 |
125 // Get a list of certificates in the certificate database of the given slot. | 125 // Get a list of certificates in the certificate database of the given slot. |
126 // Note that the callback may be run even after the database is deleted. | 126 // Note that the callback may be run even after the database is deleted. |
127 // Must be called on the IO thread and it calls |callback| on the IO thread. | 127 // Must be called on the IO thread and it calls |callback| on the IO thread. |
128 // This does not block by retrieving the certs asynchronously on a worker | 128 // This does not block by retrieving the certs asynchronously on a worker |
129 // thread. Never calls |callback| synchronously. | 129 // thread. Never calls |callback| synchronously. |
130 virtual void ListCertsInSlot(const ListCertsCallback& callback, | 130 virtual void ListCertsInSlot(const ListCertsCallback& callback, |
131 PK11SlotInfo* slot); | 131 PK11SlotInfo* slot); |
132 | 132 |
| 133 #if defined(OS_CHROMEOS) |
| 134 // Get the slot for system-wide key data. May be NULL if the system token was |
| 135 // not explicitly set. |
| 136 // Note: The System slot is set after the NSSCertDatabase is constructed and |
| 137 // this call returns synchronously. Thus, it is possible to call this function |
| 138 // before SetSystemSlot is called and get a NULL result. |
| 139 // See https://crbug.com/399554 . |
| 140 virtual crypto::ScopedPK11Slot GetSystemSlot() const; |
| 141 #endif |
| 142 |
133 // Get the default slot for public key data. | 143 // Get the default slot for public key data. |
134 crypto::ScopedPK11Slot GetPublicSlot() const; | 144 crypto::ScopedPK11Slot GetPublicSlot() const; |
135 | 145 |
136 // Get the default slot for private key or mixed private/public key data. | 146 // Get the default slot for private key or mixed private/public key data. |
137 crypto::ScopedPK11Slot GetPrivateSlot() const; | 147 crypto::ScopedPK11Slot GetPrivateSlot() const; |
138 | 148 |
139 // Get the default module for public key data. | 149 // Get the default module for public key data. |
140 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. | 150 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. |
141 // DEPRECATED: use GetPublicSlot instead. | 151 // DEPRECATED: use GetPublicSlot instead. |
142 // TODO(mattm): remove usage of this method and remove it. | 152 // TODO(mattm): remove usage of this method and remove it. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; | 301 const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; |
292 | 302 |
293 base::WeakPtrFactory<NSSCertDatabase> weak_factory_; | 303 base::WeakPtrFactory<NSSCertDatabase> weak_factory_; |
294 | 304 |
295 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); | 305 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); |
296 }; | 306 }; |
297 | 307 |
298 } // namespace net | 308 } // namespace net |
299 | 309 |
300 #endif // NET_CERT_NSS_CERT_DATABASE_H_ | 310 #endif // NET_CERT_NSS_CERT_DATABASE_H_ |
OLD | NEW |