Enterprise Encryption functions are located in a user-defined
function (UDF) library file installed in the plugin directory
(the directory named by the
plugin_dir system variable).
The UDF library base name is openssl_udf
and the suffix is platform dependent. For example, the file name
on Linux or Windows is openssl_udf.so or
openssl_udf.dll, respectively.
To install functions from the library file, use the
CREATE
FUNCTION statement. To load all functions from the
library, use this set of statements (adjust the file name suffix
as necessary):
CREATE FUNCTION asymmetric_decrypt RETURNS STRING SONAME 'openssl_udf.so'; CREATE FUNCTION asymmetric_derive RETURNS STRING SONAME 'openssl_udf.so'; CREATE FUNCTION asymmetric_encrypt RETURNS STRING SONAME 'openssl_udf.so'; CREATE FUNCTION asymmetric_sign RETURNS STRING SONAME 'openssl_udf.so'; CREATE FUNCTION asymmetric_verify RETURNS INTEGER SONAME 'openssl_udf.so'; CREATE FUNCTION create_asymmetric_priv_key RETURNS STRING SONAME 'openssl_udf.so'; CREATE FUNCTION create_asymmetric_pub_key RETURNS STRING SONAME 'openssl_udf.so'; CREATE FUNCTION create_dh_parameters RETURNS STRING SONAME 'openssl_udf.so'; CREATE FUNCTION create_digest RETURNS STRING SONAME 'openssl_udf.so';
Once installed, UDFs remain installed across server restarts. To
unload UDFs, use the
DROP
FUNCTION statement. For example, to unload the
key-generation functions, do this:
DROP FUNCTION create_asymmetric_priv_key; DROP FUNCTION create_asymmetric_pub_key;
In the
CREATE
FUNCTION and
DROP
FUNCTION statements, the function names must be
specified in lowercase. This differs from their use at function
invocation time, for which you can use any lettercase.
The CREATE
FUNCTION and
DROP
FUNCTION statements require the
INSERT and
DROP privilege, respectively, for
the mysql database.