Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 COMPONENTS_OS_CRYPT_KEY_STORAGE_LINUX_H_ | |
| 6 #define COMPONENTS_OS_CRYPT_KEY_STORAGE_LINUX_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 | |
| 13 // An API for retrieving OSCrypt's password from the system's password storage | |
| 14 // service | |
| 15 class KeyStorage { | |
|
Lei Zhang
2016/05/18 22:38:15
Should this be KeyStorageLinux?
cfroussios
2016/05/19 21:18:18
Done.
| |
| 16 public: | |
| 17 KeyStorage() = default; | |
| 18 virtual ~KeyStorage() = default; | |
| 19 | |
| 20 // Gets the encryption key from the OS password-managing library. If a key is | |
| 21 // not found, a new key will be generated, stored and returned. | |
| 22 virtual std::string GetKey() = 0; | |
| 23 | |
| 24 // Load the key storage. False is returned if the service is not available. | |
|
Lei Zhang
2016/05/18 22:38:15
Grammar:
- Load -> Loads
- False is returned -> R
cfroussios
2016/05/19 21:18:18
Done.
| |
| 25 virtual bool Init() = 0; | |
|
Lei Zhang
2016/05/18 22:38:15
Can we reorder the methods? I imagine users will c
cfroussios
2016/05/19 21:18:18
The code will call indeed call Init() first, but t
| |
| 26 | |
| 27 // Tries to load all known key storages. Returns the first that succeeds or | |
| 28 // null if none succeed. | |
| 29 static std::unique_ptr<KeyStorage> CreateService(); | |
| 30 | |
| 31 private: | |
| 32 DISALLOW_COPY_AND_ASSIGN(KeyStorage); | |
| 33 }; | |
| 34 | |
| 35 #endif // COMPONENTS_OS_CRYPT_KEY_STORAGE_LINUX_H_ | |
| OLD | NEW |