• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_CONTEXT_H_
6 #define CHROME_BROWSER_NET_NSS_CONTEXT_H_
7 
8 #include <string>
9 
10 #include "base/callback.h"
11 #include "base/compiler_specific.h"
12 #include "crypto/scoped_nss_types.h"
13 
14 namespace content {
15 class ResourceContext;
16 }  // namespace content
17 
18 // Returns a reference to the public slot for the user associated with
19 // |context|.  Should be called only on the IO thread.
20 crypto::ScopedPK11Slot GetPublicNSSKeySlotForResourceContext(
21     content::ResourceContext* context);
22 
23 // Returns a reference to the private slot for the user associated with
24 // |context|, if it is loaded. If it is not loaded and |callback| is non-null,
25 // the |callback| will be run once the slot is loaded.
26 // Should be called only on the IO thread.
27 crypto::ScopedPK11Slot GetPrivateNSSKeySlotForResourceContext(
28     content::ResourceContext* context,
29     const base::Callback<void(crypto::ScopedPK11Slot)>& callback)
30     WARN_UNUSED_RESULT;
31 
32 #endif  // CHROME_BROWSER_NET_NSS_CONTEXT_H_
33