1 // Copyright 2014 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.
5 #ifndef COMPONENTS_OS_CRYPT_IE7_PASSWORD_WIN_H_
6 #define COMPONENTS_OS_CRYPT_IE7_PASSWORD_WIN_H_
12 #include "base/basictypes.h"
13 #include "base/time/time.h"
15 // Contains the information read from the IE7/IE8 Storage2 key in the registry.
16 struct IE7PasswordInfo
{
21 std::wstring url_hash
;
23 // Encrypted data containing the username, password and some more undocumented
25 std::vector
<unsigned char> encrypted_data
;
27 // When the login was imported.
28 base::Time date_created
;
31 namespace ie7_password
{
33 struct DecryptedCredentials
{
34 std::wstring username
;
35 std::wstring password
;
38 // Parses a data structure to find passwords and usernames.
39 // The collection of bytes in |data| is interpreted as a special PasswordEntry
40 // structure. IE saves the login information as a binary dump of this structure.
41 // Credentials extracted from |data| end up in |credentials|.
42 bool GetUserPassFromData(const std::vector
<unsigned char>& data
,
43 std::vector
<DecryptedCredentials
>* credentials
);
45 // Decrypts usernames and passwords for a given data vector using the url as
47 // Output ends up in |credentials|.
48 bool DecryptPasswords(const std::wstring
& url
,
49 const std::vector
<unsigned char>& data
,
50 std::vector
<DecryptedCredentials
>* credentials
);
52 // Returns the hash of a url.
53 std::wstring
GetUrlHash(const std::wstring
& url
);
55 } // namespace ie7_password
57 #endif // COMPONENTS_OS_CRYPT_IE7_PASSWORD_WIN_H_