Syntax:
asymmetric_derive(pub_key_str, priv_key_str)

Derives a symmetric key using the private key of one party and the
public key of another, and returns the resulting key as a binary
string. If key derivation fails, the result is NULL.

pub_key_str and priv_key_str are valid PEM encoded key strings that
were created using the DH algorithm.

Suppose that you have two pairs of public and private keys:

SET @dhp = create_dh_parameters(1024);
SET @priv1 = create_asymmetric_priv_key('DH', @dhp);
SET @pub1 = create_asymmetric_pub_key('DH', @priv1);
SET @priv2 = create_asymmetric_priv_key('DH', @dhp);
SET @pub2 = create_asymmetric_pub_key('DH', @priv2);

Suppose further that you use the private key from one pair and the
public key from the other pair to create a symmetric key string. Then
this symmetric key identity relationship holds:

asymmetric_derive(@pub1, @priv2) = asymmetric_derive(@pub2, @priv1)

This example requires DH private/public keys as inputs, created using a
shared symmetric secret. Create the secret by passing the key length to
create_dh_parameters(), then pass the secret as the "key length" to
create_asymmetric_priv_key().

URL: https://dev.mysql.com/doc/refman/8.0/en/enterprise-encryption-functions-legacy.html

