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 CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_KEY_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_KEY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_KEY_H_ | 6 #define CHROMEOS_LOGIN_AUTH_KEY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "chromeos/chromeos_export.h" |
| 11 |
10 namespace chromeos { | 12 namespace chromeos { |
11 | 13 |
12 // Key for user authentication. The class supports hashing of plain text | 14 // Key for user authentication. The class supports hashing of plain text |
13 // passwords to generate keys as well as the use of pre-hashed keys. | 15 // passwords to generate keys as well as the use of pre-hashed keys. |
14 class Key { | 16 class CHROMEOS_EXPORT Key { |
15 public: | 17 public: |
16 enum KeyType { | 18 enum KeyType { |
17 // Plain text password. | 19 // Plain text password. |
18 KEY_TYPE_PASSWORD_PLAIN, | 20 KEY_TYPE_PASSWORD_PLAIN, |
19 // SHA256 of salt + password, first half only, lower-case hex encoded. | 21 // SHA256 of salt + password, first half only, lower-case hex encoded. |
20 KEY_TYPE_SALTED_SHA256_TOP_HALF, | 22 KEY_TYPE_SALTED_SHA256_TOP_HALF, |
21 // PBKDF2 with 256 bit AES and 1234 iterations, base64 encoded. | 23 // PBKDF2 with 256 bit AES and 1234 iterations, base64 encoded. |
22 KEY_TYPE_SALTED_PBKDF2_AES256_1234, | 24 KEY_TYPE_SALTED_PBKDF2_AES256_1234, |
23 }; | 25 }; |
24 | 26 |
(...skipping 17 matching lines...) Expand all Loading... |
42 | 44 |
43 private: | 45 private: |
44 KeyType key_type_; | 46 KeyType key_type_; |
45 std::string salt_; | 47 std::string salt_; |
46 std::string secret_; | 48 std::string secret_; |
47 std::string label_; | 49 std::string label_; |
48 }; | 50 }; |
49 | 51 |
50 } // namespace chromeos | 52 } // namespace chromeos |
51 | 53 |
52 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_KEY_H_ | 54 #endif // CHROMEOS_LOGIN_AUTH_KEY_H_ |
OLD | NEW |