OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 BASE_NSS_UTIL_H_ | 5 #ifndef BASE_NSS_UTIL_H_ |
6 #define BASE_NSS_UTIL_H_ | 6 #define BASE_NSS_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
9 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
10 | 11 |
11 #if defined(USE_NSS) | 12 #if defined(USE_NSS) |
12 class FilePath; | 13 class FilePath; |
13 #endif // defined(USE_NSS) | 14 #endif // defined(USE_NSS) |
14 | 15 |
15 // This file specifically doesn't depend on any NSS or NSPR headers because it | 16 // This file specifically doesn't depend on any NSS or NSPR headers because it |
16 // is included by various (non-crypto) parts of chrome to call the | 17 // is included by various (non-crypto) parts of chrome to call the |
17 // initialization functions. | 18 // initialization functions. |
18 namespace base { | 19 namespace base { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // | 73 // |
73 // Note that this does not load libnssckbi.so which contains the root | 74 // Note that this does not load libnssckbi.so which contains the root |
74 // certificates. | 75 // certificates. |
75 void LoadNSSLibraries(); | 76 void LoadNSSLibraries(); |
76 | 77 |
77 // Check if the current NSS version is greater than or equals to |version|. | 78 // Check if the current NSS version is greater than or equals to |version|. |
78 // A sample version string is "3.12.3". | 79 // A sample version string is "3.12.3". |
79 bool CheckNSSVersion(const char* version); | 80 bool CheckNSSVersion(const char* version); |
80 | 81 |
81 #if defined(OS_CHROMEOS) | 82 #if defined(OS_CHROMEOS) |
82 // Open the r/w nssdb that's stored inside the user's encrypted home directory. | 83 // Open the r/w nssdb that's stored inside the user's encrypted home |
83 void OpenPersistentNSSDB(); | 84 // directory. If |load_opencryptoki| is true, then load the |
| 85 // opencryptoki module. |
| 86 void OpenPersistentNSSDB(bool load_opencryptoki); |
| 87 |
| 88 // Get name for the built-in TPM token on ChromeOS. |
| 89 std::string GetTPMTokenName(); |
84 #endif | 90 #endif |
85 | 91 |
86 // Convert a NSS PRTime value into a base::Time object. | 92 // Convert a NSS PRTime value into a base::Time object. |
87 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. | 93 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. |
88 Time PRTimeToBaseTime(int64 prtime); | 94 Time PRTimeToBaseTime(int64 prtime); |
89 | 95 |
90 #if defined(USE_NSS) | 96 #if defined(USE_NSS) |
91 // Exposed for unittests only. |path| should be an existing directory under | 97 // Exposed for unittests only. |path| should be an existing directory under |
92 // which the DB files will be placed. |description| is a user-visible name for | 98 // which the DB files will be placed. |description| is a user-visible name for |
93 // the DB, as a utf8 string, which will be truncated at 32 bytes. | 99 // the DB, as a utf8 string, which will be truncated at 32 bytes. |
(...skipping 19 matching lines...) Expand all Loading... |
113 private: | 119 private: |
114 Lock *lock_; | 120 Lock *lock_; |
115 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); | 121 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); |
116 }; | 122 }; |
117 | 123 |
118 #endif // defined(USE_NSS) | 124 #endif // defined(USE_NSS) |
119 | 125 |
120 } // namespace base | 126 } // namespace base |
121 | 127 |
122 #endif // BASE_NSS_UTIL_H_ | 128 #endif // BASE_NSS_UTIL_H_ |
OLD | NEW |