PHP Класс ParagonIE\Halite\Password

Наследование: implements ParagonIE\Halite\Contract\PasswordInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
hash ( HiddenString $password, EncryptionKey $secretKey, string $level = KeyFactory::INTERACTIVE ) : string Hash then encrypt a password
needsRehash ( string $stored, EncryptionKey $secretKey, string $level = KeyFactory::INTERACTIVE ) : boolean Is this password hash stale?
verify ( HiddenString $password, string $stored, EncryptionKey $secretKey ) : boolean Decrypt then verify a password

Защищенные методы

Метод Описание
getConfig ( string $stored ) : SymmetricConfig Get the configuration for this version of halite

Описание методов

getConfig() защищенный статический Метод

Get the configuration for this version of halite
protected static getConfig ( string $stored ) : SymmetricConfig
$stored string A stored password hash
Результат SymmetricConfig

hash() публичный статический Метод

Hash then encrypt a password
public static hash ( HiddenString $password, EncryptionKey $secretKey, string $level = KeyFactory::INTERACTIVE ) : string
$password HiddenString The user's password
$secretKey EncryptionKey The master key for all passwords
$level string The security level for this password
Результат string An encrypted hash to store

needsRehash() публичный статический Метод

Is this password hash stale?
public static needsRehash ( string $stored, EncryptionKey $secretKey, string $level = KeyFactory::INTERACTIVE ) : boolean
$stored string Encrypted password hash
$secretKey EncryptionKey The master key for all passwords
$level string The security level for this password
Результат boolean Do we need to regenerate the hash or ciphertext?

verify() публичный статический Метод

Decrypt then verify a password
public static verify ( HiddenString $password, string $stored, EncryptionKey $secretKey ) : boolean
$password HiddenString The user's password
$stored string The encrypted password hash
$secretKey EncryptionKey The master key for all passwords
Результат boolean Is this password valid?