phpDocumentor

AuthStrategyInterface

Interface AuthStrategyInterface

Tags
category

System

subpackage

Interfaces

Table of Contents

getHash()  : string
Generates a hash by given password string.
getRehashedPassword()  : string
Returns a rehashed password hash if it does not match the currently used hashing algorithm.
verify()  : bool
Verifies a given password by its stored hash from the current hashing algorithm.

Methods

getHash()

Generates a hash by given password string.

public getHash(StringType $password) : string
Parameters
$password : StringType

String that should be hashed.

Tags
throws
RuntimeException

if password_hash() could not create a hash.

Return values
string

Resulting hash.

getRehashedPassword()

Returns a rehashed password hash if it does not match the currently used hashing algorithm.

public getRehashedPassword(StringType $password, NonEmptyStringType $hash[, AuthStrategyCollection|null $authStrategyCollection = null ]) : string
Parameters
$password : StringType

Password that should be rehashed by a new algorithm.

$hash : NonEmptyStringType

Current password hash.

$authStrategyCollection : AuthStrategyCollection|null = null

Collection of hashing algorithms.

Return values
string

The new password hash.

Search results