Zend\Crypt\PublicKey\DiffieHellman::computeSecretKey
Compute the shared secret key based on the public key received from the the second party to this transaction. This should agree to the secret key the second party computes on our own public key.
Once in agreement, the key is known to only to both parties. By default, the function expects the public key to be in binary form which is the typical format when being transmitted. If you need the binary form of the shared secret key, call getSharedSecretKey() with the optional parameter for Binary output.
Signature
public function computeSecretKey(string
$publicKey,
[string
$publicKeyFormat = self::FORMAT_NUMBER,
[string
$secretKeyFormat = self::FORMAT_NUMBER]] )
Parameters
$publicKey
— string$publicKeyFormat
— string$secretKeyFormat
— string
Returns
- string