24 Oracle Key Vault Integration Accelerator
Oracle Key Vault provides accelerators to quickly spin up integration of use-cases with Key Vault. The accelerators can be used as provided or extended to suit application needs.
You can download an integration accelerator from the Oracle Key Vault management console. Oracle Key Vault provides an integration accelerator for:
- Key Management for Oracle DBMS_CRYPTO Integration Accelerator
Starting with release 21.10, Oracle Key Vault provides the Key Management for Oracle DBMS_CRYPTO integration accelerator to manage encryption keys used with DBMS_CRYPTO operations in Oracle Key Vault.
Key Management for Oracle DBMS_CRYPTO Integration Accelerator
Starting with release 21.10, Oracle Key Vault provides the Key Management for Oracle DBMS_CRYPTO integration accelerator to manage encryption keys used with DBMS_CRYPTO operations in Oracle Key Vault.
Oracle DBMS_CRYPTO package provides a PL/SQL interface to perform encrypt and decrypt operations. PL/SQL applications need to securely manage encryption keys used with DBMS_CRYPTO operations. Using this integration accelerator, you can manage the symmetric keys used with Oracle DBMS_CRYPTO operations in Oracle Key Vault. This integration accelerator package provides a PL/SQL wrapper built over an Oracle Key Vault JAVA SDK program.
- Downloading Key Management for Oracle DBMS_CRYPTO Integration Accelerator
You can download the Key Management in Oracle DBMS_CRYPTO integration accelerator from the Oracle Key Vault management console. - Using Key Management for Oracle DBMS_CRYPTO Integration Accelerator
Learn how to use Key Management for DBMS_CRYPTO integration accelerator.
Parent topic: Oracle Key Vault Integration Accelerator
Downloading Key Management for Oracle DBMS_CRYPTO Integration Accelerator
You can download the Key Management in Oracle DBMS_CRYPTO integration accelerator from the Oracle Key Vault management console.
Using Key Management for Oracle DBMS_CRYPTO Integration Accelerator
Learn how to use Key Management for DBMS_CRYPTO integration accelerator.
- Prerequisites for Using Key Management for Oracle DBMS_CRYPTO Integration Accelerator
Before you start working with the Key Management for Oracle DBMS_CRYPTO Integration Accelerator, ensure that you meet these prerequisites. - Preparing the Environment for Using Key Management for Oracle DBMS_CRYPTO Integration Accelerator
Ensure that you prepare the Oracle Database environment with the necessary permissions to run the Key Management for Oracle DBMS_CRYPTO Integration Accelerator. - Using Key Management for Oracle DBMS_CRYPTO Integration Accelerator in a PL/SQL Application
You can now use the PL/SQL packageokv_key_mgmt
supplied by the integration accelerator in your PL/SQL applications. - Extending the Functionality of Key Management for Oracle DBMS_CRYPTO Integration Accelerator
You can extend functionality of the Key Management for Oracle DBMS_CRYPTO Integration Accelerator to suite your application needs.
Prerequisites for Using Key Management for Oracle DBMS_CRYPTO Integration Accelerator
Before you start working with the Key Management for Oracle DBMS_CRYPTO Integration Accelerator, ensure that you meet these prerequisites.
-
Enroll Oracle Database as an endpoint to Oracle Key Vault 21.10 or later, on which you intend to run the sample Oracle DBMS_CRYPTO application.
Note:
For more information see, About Endpoint Enrollment and Provisioning - Ensure that you have Java 8 or later.
- Ensure that Oracle Database is patched with the latest Oracle JVM.
-
Set the
OKV_HOME
environment variable appropriately.Note:
The$OKV_HOME
is the destination directory for the endpoint software that you specified with the-d
option during the endpoint installation. - Check if the
okvclient.ora
file is available and created as part of the endpoint enrollment. Theokvclient.ora
file is usually located at$OKV_HOME/conf/okvclient.ora
. -
Ensure that
okv_jsdk.zip
is unzipped under$OKV_HOME
.In Bash UNIX shell:$ cd $OKV_HOME $ unzip -o okv_jsdk.zip
Note:
For information about downloading the Oracle Key Vault Java SDK, see Oracle Key Vault Developer's Guide - Extract the contents of
okv_key_management_dbms_crypto.zip
to a separate folder.The
okv_key_management_dbms_crypto.zip
file contains the following:-
setup_java_permissions.sql
: This SQL script sets up the required Java security permissions and database privileges to access the resources stored within the database. KeyManager.java
: This program creates and fetches a symmetric key from the Oracle Key Vault server using APIs from Oracle Key Vault Java SDK.okv_key_mgmt.pkb
: A PL/SQL wrapper that invokes the Oracle Key Vault Java SDK API (throughKeyManager.java
) to perform create and fetch operations of symmetric key in Oracle Key Vault.dbms_crypto_using_okv_keymgmt.sql
: Oracle DBMS_CRYPTO use case for demonstrating key management in Oracle Key Vault using Java SDK.README.txt
: Instructions to set up and run the sample Oracle DBMS_CRYPTO application.
-
Preparing the Environment for Using Key Management for Oracle DBMS_CRYPTO Integration Accelerator
Ensure that you prepare the Oracle Database environment with the necessary permissions to run the Key Management for Oracle DBMS_CRYPTO Integration Accelerator.
Using Key Management for Oracle DBMS_CRYPTO Integration Accelerator in a PL/SQL Application
You can now use the PL/SQL package okv_key_mgmt
supplied by
the integration accelerator in your PL/SQL applications.
okv_key_mgmt
package provides the following functions to integrate key management with Oracle Key Vault.
create_key
: Creates a symmetric key in Oracle Key Vault. This is a wrapper function callingKeyManager.java:createKey()
which makes use of the Oracle Key Vault Java SDK APIs to create a symmetric key in Oracle Key Vault.fetch_key
: Fetches a symmetric key from Oracle Key Vault. This is a wrapper function callingKeyManager.java:fetchKey()
which makes use of the Oracle Key Vault Java SDK APIs to fetch a symmetric key in Oracle Key Vault.
You can modify PL/SQL applications that perform symmetric key based crypto operations using DBMS_CRYPTO to fetch and use the keys from Oracle Key Vault using okv_key_mgmt
package. This way, you can simplify the key management for your PL/SQL applications.
Review the supplied sample application dbms_crypto_using_okv_keymgmt.sql
included with the integration accelerator to learn how to use key management functions of the okv_key_mgmt
package.
You can run the sample application dbms_crypto_using_okv_keymgmt.sql
included with the Key Management for DBMS_CRYPTO integration accelerator
package.
The Key Management for DBMS_CRYPTO integration accelerator provides basic functions to demonstrate the management of keys for PL/SQL application in Oracle Key Vault. You can modify the supplied Java SDK program KeyManager.java
and PL/SQL wrapper package okv_key_mgmt.pkb
to extend its functionality to cover more advanced usage.
Extending the Functionality of Key Management for Oracle DBMS_CRYPTO Integration Accelerator
You can extend functionality of the Key Management for Oracle DBMS_CRYPTO Integration Accelerator to suite your application needs.
The available PL/SQL wrapper package okv_key_mgmt.pkb
provides only
the basic functions create_key()
and fetch_key()
to create and fetch a key respectively. The function fetch_key()
requires the unique identifier of the key (key ID) as input.
In many cases, you may find it easier to associate human-friendly names to the keys.
That way, you must first retrieve the ID of the key by locating the key using its
name and then pass the retrieved key ID to fetch_key()
to obtain
the key to use with DBMS_CRYPTO operations. The available
create_key()
function already accepts a name to associate with
the newly created key. However, the function to locate a key by its name is not
available.
KeyManager.java
and PL/SQL wrapper package
okv_key_mgmt.pkb
using the following procedure: