Go to the latest version of this document.

# ``twisted`.`cred`.`credentials`.`IUsernameHashedPassword``

interface documentation

`class IUsernameHashedPassword(ICredentials): (source)`

Constructor: `IUsernameHashedPassword()`

Known implementations: `twisted.cred.credentials.CramMD5Credentials`, `twisted.cred.credentials.DigestedCredentials`, `twisted.cred.credentials.UsernameHashedPassword`, `twisted.mail.pop3.APOPCredentials`, `twisted.spread.pb._PortalAuthChallenger`

View In Hierarchy

I encapsulate a username and a hashed password.

This credential is used when a hashed password is received from the party requesting authentication. CredentialCheckers which check this kind of credential must store the passwords in plaintext (or as password-equivalent hashes) form so that they can be hashed in a manner appropriate for the particular credentials class.

Method | `__init__` | IUsernameHashedPassword does not have any particular requirement upon its constructor.
Method | `checkPassword` | Validate these credentials against the correct password.
Attribute | `username` | The username associated with these credentials.

def __init__(self): (source)

IUsernameHashedPassword does not have any particular requirement upon its constructor.

def checkPassword(password): (source)

Validate these credentials against the correct password.

Parameters
password:`bytes` | The correct, plaintext password against which to check.

Returns
`bool` or `Deferred` | `True` if the credentials represented by this object match the given password, `False` if they do not, or a `Deferred` which will be called back with one of these values.

username: `bytes` = (source)

The username associated with these credentials.