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

Side by Side Diff: chromeos/cryptohome/cryptohome_library.h

Issue 25975002: cryptohome: Move Encrypt/DecryptWithSystemSalt() out of CryptohomeLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_LIBRARY_H_ 5 #ifndef CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_
6 #define CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_ 6 #define CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 20 matching lines...) Expand all
31 static CryptohomeLibrary* GetTestImpl(); 31 static CryptohomeLibrary* GetTestImpl();
32 32
33 // Public so that result of GetTestImpl can be destroyed. 33 // Public so that result of GetTestImpl can be destroyed.
34 virtual ~CryptohomeLibrary(); 34 virtual ~CryptohomeLibrary();
35 35
36 // Returns system hash in hex encoded ascii format. Note: this may return 36 // Returns system hash in hex encoded ascii format. Note: this may return
37 // an empty string (e.g. if cryptohome is not running). It is up to the 37 // an empty string (e.g. if cryptohome is not running). It is up to the
38 // calling function to try again after a delay if desired. 38 // calling function to try again after a delay if desired.
39 virtual std::string GetSystemSalt() = 0; 39 virtual std::string GetSystemSalt() = 0;
40 40
41 // Encrypts |token| with the system salt key (stable for the lifetime
42 // of the device). Useful to avoid storing plain text in place like
43 // Local State.
44 virtual std::string EncryptWithSystemSalt(const std::string& token) = 0;
45
46 // Decrypts |token| with the system salt key (stable for the lifetime
47 // of the device).
48 virtual std::string DecryptWithSystemSalt(
49 const std::string& encrypted_token_hex) = 0;
50
51 protected: 41 protected:
52 CryptohomeLibrary(); 42 CryptohomeLibrary();
53 43
54 private: 44 private:
55 DISALLOW_COPY_AND_ASSIGN(CryptohomeLibrary); 45 DISALLOW_COPY_AND_ASSIGN(CryptohomeLibrary);
56 }; 46 };
57 47
58 } // namespace chromeos 48 } // namespace chromeos
59 49
60 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_ 50 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698