OLD | NEW |
---|---|
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 CHROME_BROWSER_CHROMEOS_CROS_CERT_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_CERT_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_CERT_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_CERT_LIBRARY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 | 94 |
95 // Returns the current list of user certificates. | 95 // Returns the current list of user certificates. |
96 virtual const CertList& GetUserCertificates() const = 0; | 96 virtual const CertList& GetUserCertificates() const = 0; |
97 | 97 |
98 // Returns the current list of server certificates. | 98 // Returns the current list of server certificates. |
99 virtual const CertList& GetServerCertificates() const = 0; | 99 virtual const CertList& GetServerCertificates() const = 0; |
100 | 100 |
101 // Returns the current list of server CA certificates. | 101 // Returns the current list of server CA certificates. |
102 virtual const CertList& GetCACertificates() const = 0; | 102 virtual const CertList& GetCACertificates() const = 0; |
103 | 103 |
104 // Encrypts |token| with supplemental user key. | 104 // Encrypts |token| with the system salt key (stable for the lifetime |
105 // of the device). Useful to avoid storing plain text in place like | |
106 // Local State. | |
107 virtual std::string EncryptDeviceToken(const std::string& token) = 0; | |
zel
2013/03/14 20:22:12
EncryptWithSystemSalt might be a better name here.
David Roche
2013/03/14 23:03:29
Done.
| |
108 | |
109 // Decrypts |token| with the system salt key (stable for the lifetime | |
110 // of the device). | |
111 virtual std::string DecryptDeviceToken( | |
112 const std::string& encrypted_token_hex) = 0; | |
113 | |
114 // Encrypts |token| with supplemental user key (unique for each user). | |
105 virtual std::string EncryptToken(const std::string& token) = 0; | 115 virtual std::string EncryptToken(const std::string& token) = 0; |
zel
2013/03/14 20:22:12
can we rename these to (Encrypt|Decrypt)WithUserKe
David Roche
2013/03/14 23:03:29
Done.
| |
106 | 116 |
107 // Decrypts |token| with supplemental user key. | 117 // Decrypts |token| with supplemental user key (unique for each user). |
108 virtual std::string DecryptToken(const std::string& encrypted_token) = 0; | 118 virtual std::string DecryptToken(const std::string& encrypted_token_hex) = 0; |
109 }; | 119 }; |
110 | 120 |
111 } // namespace chromeos | 121 } // namespace chromeos |
112 | 122 |
113 #endif // CHROME_BROWSER_CHROMEOS_CROS_CERT_LIBRARY_H_ | 123 #endif // CHROME_BROWSER_CHROMEOS_CROS_CERT_LIBRARY_H_ |
OLD | NEW |