Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_PASSPHRASE_H_ | |
| 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_PASSPHRASE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 | |
| 12 // This class can be used to derive a hash of a provided passphrase. When an | |
| 13 // empty salt is given as parameter to the constructor, a new salt is | |
| 14 // generated randomly, which can be accessed through the |GetSalt| method. | |
| 15 class ManagedUserPassphrase { | |
| 16 public: | |
| 17 explicit ManagedUserPassphrase(const std::string& salt); | |
| 18 ~ManagedUserPassphrase(); | |
| 19 | |
| 20 std::string GetSalt(); | |
|
Bernhard Bauer
2013/01/08 17:43:14
Newlines before comments would be nice.
Adrian Kuegel
2013/01/09 12:10:05
Done.
| |
| 21 // This function generates a hash from a passphrase, which should be provided | |
| 22 // as the first parameter. On return, the second parameter will contain the | |
| 23 // Base64-encoded hash of the password. | |
| 24 void GenerateHashFromPassphrase(const std::string& passphrase, | |
| 25 std::string* encoded_passphrase_hash); | |
|
Bernhard Bauer
2013/01/08 17:43:14
Align the parameter please.
Adrian Kuegel
2013/01/09 12:10:05
Done.
| |
| 26 | |
| 27 private: | |
| 28 void GetPassphraseHash(const std::string& passphrase, | |
| 29 std::string* passphrase_hash); | |
|
Bernhard Bauer
2013/01/08 17:43:14
Align please.
Adrian Kuegel
2013/01/09 12:10:05
Done.
| |
| 30 void GenerateRandomSalt(); | |
| 31 | |
| 32 std::string salt_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(ManagedUserPassphrase); | |
| 35 }; | |
| 36 | |
| 37 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_PASSPHRASE_H_ | |
| OLD | NEW |