OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CRYPTO_SCOPED_TEST_SYSTEM_NSS_KEY_SLOT_H_ | |
6 #define CRYPTO_SCOPED_TEST_SYSTEM_NSS_KEY_SLOT_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "crypto/crypto_export.h" | |
11 | |
12 namespace crypto { | |
13 | |
14 class ScopedTestNSSDB; | |
15 | |
16 // Opens a persistent NSS software database in a temporary directory and sets | |
17 // the test system slot to the opened database. This helper should be created in | |
18 // tests where no system token is provided by the Chaps module and before | |
19 // InitializeTPMTokenAndSystemSlot is called. Then the opened test database will | |
20 // be used and the initialization continues as | |
21 // if Chaps had provided this test database. In particular, the DB will be | |
22 // exposed | |
23 // by |GetSystemNSSKeySlot| and |IsTPMTokenReady| will return true. | |
24 // At most one instance of this helper must be used at a time. | |
Ryan Sleevi
2014/07/24 23:14:02
wrapping on the comment.
pneubeck (no reviews)
2014/07/25 08:35:14
Done.
| |
25 class CRYPTO_EXPORT_PRIVATE ScopedTestSystemNSSKeySlot { | |
26 public: | |
27 explicit ScopedTestSystemNSSKeySlot(); | |
28 ~ScopedTestSystemNSSKeySlot(); | |
29 | |
30 bool ConstructedSuccessfully() const; | |
31 | |
32 private: | |
33 scoped_ptr<ScopedTestNSSDB> test_db_; | |
34 | |
35 DISALLOW_COPY_AND_ASSIGN(ScopedTestSystemNSSKeySlot); | |
36 }; | |
37 | |
38 } // namespace crypto | |
39 | |
40 #endif // CRYPTO_SCOPED_TEST_SYSTEM_NSS_KEY_SLOT_H_ | |
OLD | NEW |