OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ | 5 #ifndef CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ |
6 #define CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ | 6 #define CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // This struct holds metadata that will be stored alongside the key. Each | 78 // This struct holds metadata that will be stored alongside the key. Each |
79 // |ProviderData| entry must have a |name| and may hold either a |number| or a | 79 // |ProviderData| entry must have a |name| and may hold either a |number| or a |
80 // sequence of |bytes|. The metadata is entirely opaque to cryptohome. It is | 80 // sequence of |bytes|. The metadata is entirely opaque to cryptohome. It is |
81 // stored with the key and returned when requested but is never interpreted by | 81 // stored with the key and returned when requested but is never interpreted by |
82 // cryptohome in any way. The metadata can be used to store information such | 82 // cryptohome in any way. The metadata can be used to store information such |
83 // as the hashing algorithm and the salt used to create the key. | 83 // as the hashing algorithm and the salt used to create the key. |
84 struct ProviderData { | 84 struct ProviderData { |
85 ProviderData(); | 85 ProviderData(); |
86 explicit ProviderData(const std::string& name); | 86 explicit ProviderData(const std::string& name); |
87 explicit ProviderData(const ProviderData& other); | 87 explicit ProviderData(const ProviderData& other); |
| 88 ProviderData(const std::string& name, int64 number); |
| 89 ProviderData(const std::string& name, const std::string& bytes); |
88 void operator=(const ProviderData& other); | 90 void operator=(const ProviderData& other); |
89 ~ProviderData(); | 91 ~ProviderData(); |
90 | 92 |
91 bool operator==(const ProviderData& other) const; | 93 bool operator==(const ProviderData& other) const; |
92 | 94 |
93 std::string name; | 95 std::string name; |
94 scoped_ptr<int64> number; | 96 scoped_ptr<int64> number; |
95 scoped_ptr<std::string> bytes; | 97 scoped_ptr<std::string> bytes; |
96 }; | 98 }; |
97 | 99 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // used as the backend. | 140 // used as the backend. |
139 bool ephemeral; | 141 bool ephemeral; |
140 | 142 |
141 // If not empty, home dir will be created with these keys if it exist. | 143 // If not empty, home dir will be created with these keys if it exist. |
142 std::vector<KeyDefinition> create_keys; | 144 std::vector<KeyDefinition> create_keys; |
143 }; | 145 }; |
144 | 146 |
145 } // namespace cryptohome | 147 } // namespace cryptohome |
146 | 148 |
147 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ | 149 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ |
OLD | NEW |