PHP Class ParagonIE\Halite\Password

Inheritance: implements ParagonIE\Halite\Contract\PasswordInterface
Afficher le fichier Open project: paragonie/halite Class Usage Examples

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
getConfig ( string $stored ) : SymmetricConfig Get the configuration for this version of halite

Method Details

getConfig() protected static méthode

Get the configuration for this version of halite
protected static getConfig ( string $stored ) : SymmetricConfig
$stored string A stored password hash
Résultat SymmetricConfig

hash() public static méthode

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
Résultat string An encrypted hash to store

needsRehash() public static méthode

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
Résultat boolean Do we need to regenerate the hash or ciphertext?

verify() public static méthode

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
Résultat boolean Is this password valid?