trait PasswordProtected (View source)

Password Protected Trait for Private Keys

Methods

withPassword(string|bool $password = false)

Sets the password

Details

withPassword(string|bool $password = false)

Sets the password

Private keys can be encrypted with a password. To unset the password, pass in the empty string or false. Or rather, pass in $password such that empty($password) && !is_string($password) is true.

Parameters

string|bool $password

See also

\self::createKey()
\self::load()