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 CRYPTO_NSS_UTIL_INTERNAL_H_ | 5 #ifndef CRYPTO_NSS_UTIL_INTERNAL_H_ |
6 #define CRYPTO_NSS_UTIL_INTERNAL_H_ | 6 #define CRYPTO_NSS_UTIL_INTERNAL_H_ |
7 | 7 |
8 #include <secmodt.h> | 8 #include <secmodt.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Returns a reference to the default slot for storing private-key and | 29 // Returns a reference to the default slot for storing private-key and |
30 // mixed private-key/public-key data. Returns a hardware (TPM) NSS | 30 // mixed private-key/public-key data. Returns a hardware (TPM) NSS |
31 // key slot if on ChromeOS and EnableTPMForNSS() has been called | 31 // key slot if on ChromeOS and EnableTPMForNSS() has been called |
32 // successfully. Caller must release returned reference with | 32 // successfully. Caller must release returned reference with |
33 // PK11_FreeSlot. | 33 // PK11_FreeSlot. |
34 CRYPTO_EXPORT PK11SlotInfo* GetPrivateNSSKeySlot() WARN_UNUSED_RESULT; | 34 CRYPTO_EXPORT PK11SlotInfo* GetPrivateNSSKeySlot() WARN_UNUSED_RESULT; |
35 | 35 |
36 // A helper class that acquires the SECMOD list read lock while the | 36 // A helper class that acquires the SECMOD list read lock while the |
37 // AutoSECMODListReadLock is in scope. | 37 // AutoSECMODListReadLock is in scope. |
38 class AutoSECMODListReadLock { | 38 class CRYPTO_EXPORT AutoSECMODListReadLock { |
39 public: | 39 public: |
40 AutoSECMODListReadLock(); | 40 AutoSECMODListReadLock(); |
41 ~AutoSECMODListReadLock(); | 41 ~AutoSECMODListReadLock(); |
42 | 42 |
43 private: | 43 private: |
44 SECMODListLock* lock_; | 44 SECMODListLock* lock_; |
45 DISALLOW_COPY_AND_ASSIGN(AutoSECMODListReadLock); | 45 DISALLOW_COPY_AND_ASSIGN(AutoSECMODListReadLock); |
46 }; | 46 }; |
47 | 47 |
48 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
(...skipping 24 matching lines...) Expand all Loading... |
73 // loaded and |callback| is non-null, the |callback| will be run once the slot | 73 // loaded and |callback| is non-null, the |callback| will be run once the slot |
74 // is loaded. | 74 // is loaded. |
75 CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser( | 75 CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser( |
76 const std::string& username_hash, | 76 const std::string& username_hash, |
77 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; | 77 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; |
78 #endif // defined(OS_CHROMEOS) | 78 #endif // defined(OS_CHROMEOS) |
79 | 79 |
80 } // namespace crypto | 80 } // namespace crypto |
81 | 81 |
82 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_ | 82 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_ |
OLD | NEW |