Wt: Wt::Auth::PasswordService::AbstractVerifier Class Reference

Wt 4.10.4

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Wt::Auth::PasswordService::AbstractVerifier Class Referenceabstract

Abstract password hash computation and verification class. More...

`#include <PasswordService.h>`

Inheritance diagram for Wt::Auth::PasswordService::AbstractVerifier:
[legend]

## Public Member Functions
virtual | ~AbstractVerifier ()
| Destructor.
virtual bool | needsUpdate (const PasswordHash &hash) const =0
| Returns whether a password hash needs to be updated (recomputed).
virtual PasswordHash | hashPassword (const WString &password) const =0
| Computes the password hash for a clear text password.
virtual bool | verify (const WString &password, const PasswordHash &hash) const =0
| Verifies a password against a hash.

## Detailed Description

Abstract password hash computation and verification class.

This class defines the interface for verifying a passwords against password hashes, or computing a new password hash for a password.

See also
  setVerifier()

## Member Function Documentation

## ◆ hashPassword()

virtual PasswordHash Wt::Auth::PasswordService::AbstractVerifier::hashPassword | ( | const WString & | password | ) | const
| pure virtual

Computes the password hash for a clear text password.

This must return a hash that can later be used to verify the user's password, but which avoids compromising the user's password in case of loss.

Implemented in Wt::Auth::PasswordVerifier.

## ◆ needsUpdate()

virtual bool Wt::Auth::PasswordService::AbstractVerifier::needsUpdate | ( | const PasswordHash & | hash | ) | const
| pure virtual

Returns whether a password hash needs to be updated (recomputed).

A `hash` may need to be updated if it has been computed with a cryptographic method that is being disfavoured.

Implemented in Wt::Auth::PasswordVerifier.

## ◆ verify()

virtual bool Wt::Auth::PasswordService::AbstractVerifier::verify | ( | const WString & | password,
|  | const PasswordHash & | hash ) const
| pure virtual

Verifies a password against a hash.

This returns whether the given password matches with the user's credentials stored in the hash.

Implemented in Wt::Auth::PasswordVerifier.