Bug #31982 Public/private key encryption function
Submitted: 31 Oct 2007 10:16 Modified: 14 Nov 2007 7:17
Reporter: Wim Godden Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[31 Oct 2007 10:16] Wim Godden
Description:
It would be nice to see functions to use public/private key encryption.
MS-SQL has EncryptByCert and DecryptByCert.
PostgreSQL has pgp_pub_encrypt and pgp_pub_decrypt.
MySQL has no such functions. It would be nice to have such functions, so public key encryption could be done outside MySQL and decryption could be done within a stored procedure containing the private key.

How to repeat:
Feature request
[14 Nov 2007 7:17] Valeriy Kravchuk
Thank you for a reasonable feature request.
[29 Dec 2017 20:49] Daniƫl van Eeden
https://www.mysql.com/products/enterprise/encryption.html

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
MySQL Enterprise Encryption gives DBAs and Developers the tools they need for:

    Asymmetric Public Key Encryption (RSA)
    Asymmetric Private Key Decryption (RSA)
    Generate Public/Private Key (RSA, DSA, DH)
    Derive Symmetric Keys from Public and Private Key pairs (DH)
    Digitally Sign Data (RSA, DSA)
    Verify Data Signature (RSA, DSA)
    Validation Data Authenticity (RSA, DSA)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

So looks like this is available as an enterprise feature.

https://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption.html
"As of MySQL 5.7.9, MySQL Enterprise Edition includes a set of encryption functions based on the OpenSSL library that expose OpenSSL capabilities at the SQL level."