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

Side by Side Diff: chrome/browser/managed_mode/managed_user_passphrase.h

Issue 15715005: Remove passphrase dialog and last parts of elevation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 7 years, 6 months 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
(Empty)
1 // Copyright (c) 2013 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();
21
22 // This function generates a hash from a passphrase, which should be provided
23 // as the first parameter. On return, the second parameter will contain the
24 // Base64-encoded hash of the password.
25 bool GenerateHashFromPassphrase(const std::string& passphrase,
26 std::string* encoded_passphrase_hash) const;
27
28 private:
29 bool GetPassphraseHash(const std::string& passphrase,
30 std::string* passphrase_hash) const;
31 void GenerateRandomSalt();
32
33 std::string salt_;
34
35 DISALLOW_COPY_AND_ASSIGN(ManagedUserPassphrase);
36 };
37
38 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_PASSPHRASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698