# eric6.WebBrowser.Passwords.PasswordManager

Module implementing the password manager.

### Global Attributes

None

### Classes

PasswordManager | Class implementing the password manager.

### Functions

None

## PasswordManager

Class implementing the password manager.

### Signals

changed()
  emitted to indicate a change
passwordsSaved()
  emitted after the passwords were saved

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

PasswordManager | Constructor
__createKey | Private method to create the key string for the login credentials.
__load | Private method to load the saved login credentials.
__stripUrl | Private method to strip off all unneeded parts of a URL.
allSiteNames | Public method to get a list of all site names.
clear | Public slot to clear the saved passwords.
close | Public method to close the passwords manager.
completePage | Public slot to complete login forms with saved data.
formSubmitted | Public method to record login data.
getFileName | Public method to get the file name of the passwords file.
getLogin | Public method to get the login credentials.
masterPasswordChanged | Public slot to handle the change of the master password.
reload | Public method to reload the login data.
removePassword | Public method to remove a password entry.
save | Public slot to save the login entries to disk.
setLogin | Public method to set the login credentials.
siteInfo | Public method to get a reference to the named site.
sitesCount | Public method to get the number of available sites.

### Static Methods

None

#### PasswordManager (Constructor)

PasswordManager(parent=None)

Constructor

parent
  reference to the parent object (QObject)

#### PasswordManager.__createKey

__createKey(url, realm)

Private method to create the key string for the login credentials.

url
  URL to get the credentials for (QUrl)
realm
  realm to get the credentials for (string)

Returns:
  key string (string)

#### PasswordManager.__load

__load()

Private method to load the saved login credentials.

#### PasswordManager.__stripUrl

__stripUrl(url)

Private method to strip off all unneeded parts of a URL.

url
  URL to be stripped (QUrl)

Returns:
  stripped URL (QUrl)

#### PasswordManager.allSiteNames

allSiteNames()

Public method to get a list of all site names.

Returns:
  sorted list of all site names (list of strings)

#### PasswordManager.clear

clear()

Public slot to clear the saved passwords.

#### PasswordManager.close

close()

Public method to close the passwords manager.

#### PasswordManager.completePage

completePage(page)

Public slot to complete login forms with saved data.

page
  reference to the web page (WebBrowserPage)

#### PasswordManager.formSubmitted

formSubmitted(urlStr, userName, password, data, page)

Public method to record login data.

urlStr (str)
  form submission URL
userName (str)
  name of the user
password (str)
  user password
data (QByteArray)
  data to be submitted
page (QWebEnginePage)
  reference to the calling page

#### PasswordManager.getFileName

getFileName()

Public method to get the file name of the passwords file.

Returns:
  name of the passwords file (string)

#### PasswordManager.getLogin

getLogin(url, realm)

Public method to get the login credentials.

url
  URL to get the credentials for (QUrl)
realm
  realm to get the credentials for (string)

Returns:
  tuple containing the user name (string) and password (string)

#### PasswordManager.masterPasswordChanged

masterPasswordChanged(oldPassword, newPassword)

Public slot to handle the change of the master password.

oldPassword
  current master password (string)
newPassword
  new master password (string)

#### PasswordManager.reload

reload()

Public method to reload the login data.

#### PasswordManager.removePassword

removePassword(site)

Public method to remove a password entry.

site
  web site name (string)

#### PasswordManager.save

save()

Public slot to save the login entries to disk.

#### PasswordManager.setLogin

setLogin(url, realm, username, password)

Public method to set the login credentials.

url
  URL to set the credentials for (QUrl)
realm
  realm to set the credentials for (string)
username
  username for the login (string)
password
  password for the login (string)

#### PasswordManager.siteInfo

siteInfo(site)

Public method to get a reference to the named site.

site
  web site name (string)

Returns:
  tuple containing the user name (string) and password (string)

#### PasswordManager.sitesCount

sitesCount()

Public method to get the number of available sites.

Returns:
  number of sites (integer)

Up