OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_ |
| 6 #define CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "crypto/scoped_nss_types.h" |
| 10 |
| 11 namespace content { |
| 12 class ResourceContext; |
| 13 } |
| 14 namespace net { |
| 15 class NSSCertDatabase; |
| 16 } |
| 17 |
| 18 // XXX how should these interact with tests (should they return the |
| 19 // ScopedTestNSSDB if it's active?) |
| 20 |
| 21 // Returns a reference to the public slot for |context|. |
| 22 // Should be called only on the IO thread. |
| 23 crypto::ScopedPK11Slot GetPublicNSSKeySlotForResourceContext( |
| 24 content::ResourceContext* context); |
| 25 |
| 26 // Returns a reference to the private slot for |context|. |
| 27 // Should be called only on the IO thread. |
| 28 // May return NULL if the slot is not ready yet. |
| 29 crypto::ScopedPK11Slot GetPrivateNSSKeySlotForResourceContext( |
| 30 content::ResourceContext* context); |
| 31 |
| 32 // Runs |callback| with the private slot handle when the private slot is loaded. |
| 33 // If the slot is already loaded, the |callback| will be run synchronously. |
| 34 // Should be called only on the IO thread. |
| 35 void OnPrivateNSSKeySlotForResourceContextReady( |
| 36 content::ResourceContext* context, |
| 37 const base::Callback<void(crypto::ScopedPK11Slot)>& callback); |
| 38 |
| 39 // Get a NSSCertDatabase for the given |context|. |
| 40 void GetNSSCertDatabaseForResourceContext( |
| 41 content::ResourceContext* context, |
| 42 const base::Callback<void(net::NSSCertDatabase*)>& callback); |
| 43 |
| 44 |
| 45 #endif // CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_ |
OLD | NEW |