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_H_ | 5 #ifndef CRYPTO_NSS_UTIL_H_ |
6 #define CRYPTO_NSS_UTIL_H_ | 6 #define CRYPTO_NSS_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // | 88 // |
89 // Note that this does not load libnssckbi.so which contains the root | 89 // Note that this does not load libnssckbi.so which contains the root |
90 // certificates. | 90 // certificates. |
91 CRYPTO_EXPORT void LoadNSSLibraries(); | 91 CRYPTO_EXPORT void LoadNSSLibraries(); |
92 | 92 |
93 // Check if the current NSS version is greater than or equals to |version|. | 93 // Check if the current NSS version is greater than or equals to |version|. |
94 // A sample version string is "3.12.3". | 94 // A sample version string is "3.12.3". |
95 bool CheckNSSVersion(const char* version); | 95 bool CheckNSSVersion(const char* version); |
96 | 96 |
97 #if defined(OS_CHROMEOS) | 97 #if defined(OS_CHROMEOS) |
98 // Open the r/w nssdb that's stored inside the user's encrypted home | |
99 // directory. This is the default slot returned by | |
100 // GetPublicNSSKeySlot(). | |
101 CRYPTO_EXPORT void OpenPersistentNSSDB(); | |
102 | |
103 // Indicates that NSS should load the Chaps library so that we | 98 // Indicates that NSS should load the Chaps library so that we |
104 // can access the TPM through NSS. Once this is called, | 99 // can access the TPM through NSS. Once this is called, |
105 // GetPrivateNSSKeySlot() will return the TPM slot if one was found. | 100 // GetPrivateNSSKeySlot() will return the TPM slot if one was found. |
106 CRYPTO_EXPORT void EnableTPMTokenForNSS(); | 101 CRYPTO_EXPORT void EnableTPMTokenForNSS(); |
107 | 102 |
108 // Returns true if EnableTPMTokenForNSS has been called. | 103 // Returns true if EnableTPMTokenForNSS has been called. |
109 CRYPTO_EXPORT bool IsTPMTokenEnabledForNSS(); | 104 CRYPTO_EXPORT bool IsTPMTokenEnabledForNSS(); |
110 | 105 |
111 // Returns true if the TPM is owned and PKCS#11 initialized with the | 106 // Returns true if the TPM is owned and PKCS#11 initialized with the |
112 // user and security officer PINs, and has been enabled in NSS by | 107 // user and security officer PINs, and has been enabled in NSS by |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 private: | 188 private: |
194 base::Lock *lock_; | 189 base::Lock *lock_; |
195 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); | 190 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); |
196 }; | 191 }; |
197 | 192 |
198 #endif // defined(USE_NSS) | 193 #endif // defined(USE_NSS) |
199 | 194 |
200 } // namespace crypto | 195 } // namespace crypto |
201 | 196 |
202 #endif // CRYPTO_NSS_UTIL_H_ | 197 #endif // CRYPTO_NSS_UTIL_H_ |
OLD | NEW |