Chromium Code Reviews| 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 "crypto/crypto_export.h" | 10 #include "crypto/crypto_export.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 std::string* user_pin); | 109 std::string* user_pin); |
| 110 | 110 |
| 111 // Returns true if the TPM is owned and PKCS#11 initialized with the | 111 // 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 | 112 // user and security officer PINs, and has been enabled in NSS by |
| 113 // calling EnableTPMForNSS, and Chaps has been successfully | 113 // calling EnableTPMForNSS, and Chaps has been successfully |
| 114 // loaded into NSS. | 114 // loaded into NSS. |
| 115 CRYPTO_EXPORT bool IsTPMTokenReady(); | 115 CRYPTO_EXPORT bool IsTPMTokenReady(); |
| 116 | 116 |
| 117 // Initialize the TPM token. Does nothing if it is already initialized. | 117 // Initialize the TPM token. Does nothing if it is already initialized. |
| 118 CRYPTO_EXPORT bool InitializeTPMToken(const std::string& token_name, | 118 CRYPTO_EXPORT bool InitializeTPMToken(const std::string& token_name, |
| 119 const std::string& user_pin); | 119 const std::string& user_pin, |
| 120 int token_slot_id); | |
|
wtc
2013/10/25 18:06:27
Nit: I suggest listing token_slot_id immediately a
mattm
2013/10/25 18:41:37
Done.
| |
| 120 #endif | 121 #endif |
| 121 | 122 |
| 122 // Convert a NSS PRTime value into a base::Time object. | 123 // Convert a NSS PRTime value into a base::Time object. |
| 123 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. | 124 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. |
| 124 CRYPTO_EXPORT base::Time PRTimeToBaseTime(int64 prtime); | 125 CRYPTO_EXPORT base::Time PRTimeToBaseTime(int64 prtime); |
| 125 | 126 |
| 126 // Convert a base::Time object into a PRTime value. | 127 // Convert a base::Time object into a PRTime value. |
| 127 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. | 128 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. |
| 128 CRYPTO_EXPORT int64 BaseTimeToPRTime(base::Time time); | 129 CRYPTO_EXPORT int64 BaseTimeToPRTime(base::Time time); |
| 129 | 130 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 private: | 165 private: |
| 165 base::Lock *lock_; | 166 base::Lock *lock_; |
| 166 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); | 167 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); |
| 167 }; | 168 }; |
| 168 | 169 |
| 169 #endif // defined(USE_NSS) | 170 #endif // defined(USE_NSS) |
| 170 | 171 |
| 171 } // namespace crypto | 172 } // namespace crypto |
| 172 | 173 |
| 173 #endif // CRYPTO_NSS_UTIL_H_ | 174 #endif // CRYPTO_NSS_UTIL_H_ |
| OLD | NEW |