openssl_dh_compute_key
Function • Misc changes in PHP 8.2
Computes shared secret for public value of remote DH public key and local DH key.
openssl_dh_compute_key Function synopsis
openssl_dh_compute_key(string $public_key, OpenSSLAsymmetricKey $private_key): string|false
Parameters
$public_key
Typestring
DH Public key of the remote party.
$private_key
TypeOpenSSLAsymmetricKey
A local DH private key, corresponding to the public key to be shared with the remote party.
Return value
Typestring|false
Returns shared secret on success or false on failure.
Changes to the openssl_dh_compute_key Function
PHP 8.2
- Attribute added for parameter
$private_key:#[SensitiveParameter]
PHP 8.0
- Return type added:
string|false - Parameter name of parameter #1 changed:
$pub_keyto$public_key - Parameter type added for parameter #1 (
$public_key):string - Parameter name of parameter #2 changed:
$dh_keyto$private_key - Parameter type added for parameter #2 (
$private_key):OpenSSLAsymmetricKey
- openssl_dh_compute_key($pub_key, $dh_key)
+ openssl_dh_compute_key(string $public_key, OpenSSLAsymmetricKey $private_key): string|false openssl_dh_compute_key Function Availability
openssl_dh_compute_key Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |