OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 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_IMPORTER_NSS_DECRYPTOR_LINUX_H_ |
| 6 #define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_LINUX_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 namespace webkit_glue { |
| 14 struct PasswordForm; |
| 15 } |
| 16 |
| 17 // A wrapper for Firefox NSS decrypt component. |
| 18 class NSSDecryptor { |
| 19 public: |
| 20 NSSDecryptor(); |
| 21 ~NSSDecryptor(); |
| 22 |
| 23 // Initializes NSS if it hasn't already been initialized. |
| 24 bool Init(const std::wstring& /* dll_path */, |
| 25 const std::wstring& /* db_path */); |
| 26 |
| 27 // Decrypts Firefox stored passwords. Before using this method, |
| 28 // make sure Init() returns true. |
| 29 std::wstring Decrypt(const std::string& crypt) const; |
| 30 |
| 31 // Parses the Firefox password file content, decrypts the |
| 32 // username/password and reads other related information. |
| 33 // The result will be stored in |forms|. |
| 34 void ParseSignons(const std::string& content, |
| 35 std::vector<webkit_glue::PasswordForm>* forms); |
| 36 |
| 37 private: |
| 38 bool is_nss_initialized_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(NSSDecryptor); |
| 41 }; |
| 42 |
| 43 #endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_LINUX_H_ |
OLD | NEW |