GravityKit\GravityExport\Save\Service\PasswordService
Service that handles encrypting and decrypting passwords.
Since: 1.0
Source: add-ons/save/src/Service/PasswordService.php:13
Details
- Kind:
class - Namespace:
GravityKit\GravityExport\Save\Service
Methods
| Method | Description |
|---|---|
__construct() | Creates the service. |
encrypt() | Encrypts the password using a predefined secret. |
is_legacy_encryption() | Whether this was encrypted with the legacy implementation. |
decrypt() | Decrypts a hash back to a password. |
Method Reference
__construct()
public function __construct( string $secret, ?Encryption $foundation_encryption=null )
Creates the service.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$secret | string | The hashing secret. | |
$foundation_encryption | ?Encryption | null |
Since: 1.0
Source: add-ons/save/src/Service/PasswordService.php:43
encrypt()
public function encrypt( string $password ): string
Encrypts the password using a predefined secret.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$password | string | The password to encrypt. |
Returns
string— The encrypted password.
Since: 1.0
Source: add-ons/save/src/Service/PasswordService.php:57
is_legacy_encryption()
public function is_legacy_encryption( string $encrypted_password ): bool
Whether this was encrypted with the legacy implementation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$encrypted_password | string |
Returns
bool
Since: $ver$
Source: add-ons/save/src/Service/PasswordService.php:73
decrypt()
public function decrypt( string $encrypted_password ): ?string
Decrypts a hash back to a password.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$encrypted_password | string | The password to decrypt. |
Returns
string|null— The decrypted password.
Since: 1.0
Source: add-ons/save/src/Service/PasswordService.php:95