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

Side by Side Diff: components/encryptor/encryptor.h

Issue 168993002: Move encryptor API out of webdata. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ios fix Created 6 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_H_ 5 #ifndef COMPONENTS_ENCRYPTOR_ENCRYPTOR_H_
6 #define COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_H_ 6 #define COMPONENTS_ENCRYPTOR_ENCRYPTOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 11
12 // The Encryptor class gives access to simple encryption and decryption of 12 // The Encryptor class gives access to simple encryption and decryption of
13 // strings. Note that on Mac, access to the system Keychain is required and 13 // strings. Note that on Mac, access to the system Keychain is required and
14 // these calls can block the current thread to collect user input. 14 // these calls can block the current thread to collect user input.
15 class Encryptor { 15 class Encryptor {
bcwhite 2014/02/18 15:02:53 It was suggested to change the name of the class t
16 public: 16 public:
17 // Encrypt a string16. The output (second argument) is 17 // Encrypt a string16. The output (second argument) is
18 // really an array of bytes, but we're passing it back 18 // really an array of bytes, but we're passing it back
19 // as a std::string 19 // as a std::string
20 static bool EncryptString16(const base::string16& plaintext, 20 static bool EncryptString16(const base::string16& plaintext,
21 std::string* ciphertext); 21 std::string* ciphertext);
22 22
23 // Decrypt an array of bytes obtained with EncryptString16 23 // Decrypt an array of bytes obtained with EncryptString16
24 // back into a string16. Note that the input (first argument) 24 // back into a string16. Note that the input (first argument)
25 // is a std::string, so you need to first get your (binary) 25 // is a std::string, so you need to first get your (binary)
(...skipping 15 matching lines...) Expand all
41 #if defined(OS_MACOSX) 41 #if defined(OS_MACOSX)
42 // For unit testing purposes we instruct the Encryptor to use a mock Keychain 42 // For unit testing purposes we instruct the Encryptor to use a mock Keychain
43 // on the Mac. The default is to use the real Keychain. 43 // on the Mac. The default is to use the real Keychain.
44 static void UseMockKeychain(bool use_mock); 44 static void UseMockKeychain(bool use_mock);
45 #endif 45 #endif
46 46
47 private: 47 private:
48 DISALLOW_IMPLICIT_CONSTRUCTORS(Encryptor); 48 DISALLOW_IMPLICIT_CONSTRUCTORS(Encryptor);
49 }; 49 };
50 50
51 #endif // COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_H_ 51 #endif // COMPONENTS_ENCRYPTOR_ENCRYPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698