Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: crypto/nss_util.h

Issue 36593002: crypto/nss_util: Get TPM slot id, do lookup by id instead of by name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sandbox debugging crap Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
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
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_
OLDNEW
« no previous file with comments | « crypto/hmac_nss.cc ('k') | crypto/nss_util.cc » ('j') | crypto/nss_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698