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 must be valid key strings in PEM format.
They must be 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)

URL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html

