Managing Oracle Key Vault Master Encryption Keys
Managing security objects includes uploading and downloading security objects, managing the persistent master encryption key cache, and using user-defined TDE keys.
-
Using the Persistent Master Encryption Key Cache
The persistent master encryption key cache feature enables databases to be operational when the Oracle Key Vault server is unavailable.
-
Configuring an Oracle Key Vault to a New TDE-Enabled Database Connection
You can configure a connection between Oracle Key Vault and a database that has not yet been configured for Transparent Data Encryption.
-
Migrating Existing TDE Wallets to Oracle Key Vault
A migrated TDE wallet can be used to restore database contents that were previously encrypted by TDE.
-
Uploading and Downloading Oracle Wallets
To store and share Oracle wallets, you must upload them to Oracle Key Vault.
-
Uploading and Downloading JKS and JCEKS Keystores The
okvutil uploadandokvutil downloadcommands can upload and download JKS and JCEKS keystores. -
Using a User-Defined Key as the TDE Master Encryption Key
You can import a generated key to be used as the Transparent Data Encryption (TDE) master encryption key in Oracle Key Vault.
Using the Persistent Master Encryption Key Cache
The persistent master encryption key cache feature enables databases to be operational when the Oracle Key Vault server is unavailable.
-
About the Persistent Master Encryption Key Cache
The persistent master encryption key cache ensures the availability of TDE master encryption keys.
-
About Oracle Key Vault Persistent Master Encryption Key Cache Architecture
The Oracle Key Vault persistent master encryption key cache is implemented in Oracle Key Vault’s
PKCS#11library. -
Caching Master Encryption Keys in the In-Memory and Persistent Master Encryption Key Cache
After a master encryption key is created or fetched from a different location, it is stored in an Oracle Key Vault cache.
-
Storage Location of Persistent Master Encryption Key Cache
The persistent master encryption key cache is created in the same location as the configuration file
okvclient.ora. -
Persistent Master Encryption Key Cache Modes of Operation
The persistent master encryption key cache operates in two modes.
-
Persistent Master Encryption Key Cache Refresh Window
The persistent master encryption key cache refresh window helps to extend the availability of the master encryption key.
-
Persistent Master Encryption Key Cache Parameters
Oracle Key Vault provides parameters to configure the persistent master encryption key cache.
-
Listing the Contents of the Persistent Master Key Cache
The
okvutillist command can be used to list the master encryption keys that are cached in the persistent master encryption key cache. -
Oracle Database Deployments and Persistent Master Encryption Key Cache
The persistent master encryption key cache affects the integration of other Oracle features with Oracle Key Vault.
About the Persistent Master Encryption Key Cache
The persistent master encryption key cache ensures the availability of TDE master encryption keys.
It accomplishes this by reducing dependence on the state of the Oracle Key Vault server.
The TDE master encryption key is cached in the persistent master encryption key cache in addition to the in-memory cache, to make the master encryption key available across database processes. It eliminates the need for databases to contact the Oracle Key Vault server for every new process, redo log switch, or database startup operation.
The following are the benefits of ensuring availability of TDE master encryption keys:
-
Continuous operation of endpoints during upgrade, primary-standby configuration, switchover, failover, and other procedures that require an Oracle Key Vault restart operation
-
Less load on the Oracle Key Vault server when multiple sessions of a single database request the same master encryption key
-
Improved scalability of Oracle Key Vault
Note that the extractable attribute of the TDE master encryption key must be set to true, otherwise, the TDE master encryption key cannot leave Oracle Key Vault and thus it cannot be cached in either in-memory cache or the persistent master encryption key cache.
About Oracle Key Vault Persistent Master Encryption Key Cache Architecture
The Oracle Key Vault persistent master encryption key cache is implemented in Oracle Key Vault’s PKCS#11 library.
When the persistent master encryption key cache feature is configured, the Oracle Key Vault PKCS#11 library will create the persistent master encryption key cache when the first master encryption key is retrieved from Oracle Key Vault.
The persistent master encryption key cache is an auto-login wallet or a password-based wallet, depending on how Oracle Key Vault is installed:
-
If the Oracle Key Vault client is installed with a password specified, then the persistent master encryption key cache is a password-based wallet.
-
If the Oracle Key Vault client is installed without a password specified, then the persistent master encryption key cache is an auto-login wallet.
The PKCS#11 library also implements an in-memory master encryption key cache. When the in-memory master encryption key cache feature is configured, the master encryption key is cached in the process memory of the process that loaded the library into memory. The in-memory and persistent master encryption key caches are independent of each other. You can enable and disable these caches independently.
For operations that involve encryption and decryption, PKCS#11 attempts to look up the master encryption key in the in-memory master encryption key cache. If it does not find it, PKCS#11 then it looks up the master encryption key in the persistent master encryption key cache. If the master encryption key is not found in the in-memory or the persistent master encryption key cache, then it is retrieved from the Oracle Key Vault server, if the server is online.
Related Topics
Caching Master Encryption Keys in the In-Memory and Persistent Master Encryption Key Cache
After a master encryption key is created or fetched from a different location, it is stored in an Oracle Key Vault cache.
When the master encryption key is first fetched from the Oracle Key Vault server, or created in the Oracle Key Vault server, the master encryption key is stored in the in-memory master encryption key cache and in the persistent master encryption key cache.
Master encryption keys stored in the in-memory master encryption key cache are available for a limited time from the moment the key is placed into the persistent cache. The duration is defined by the PKCS11_CACHE_TIMEOUT parameter in the okvclient.ora file.
If the persistent cache exists, then it will be used. If the persistent cache does not exist, then Oracle Key Vault creates it. When the key is created, all future sessions will retrieve it from the in-memory master encryption key cache or persistent master encryption key cache.
Persistent master encryption keys that are stored in the persistent master encryption key cache are available for a limited time from the moment the key is placed into the persistent cache. You can define this time by setting the PKCS11_PERSISTENT_CACHE_TIMEOUT parameter in the okvclient.ora file.
When the endpoint deletes the master encryption key, the key will be removed from the in-memory master encryption key cache and persistent master encryption key cache.
Storage Location of Persistent Master Encryption Key Cache
The persistent master encryption key cache is created in the same location as the configuration file okvclient.ora.
The default location for the okvclient.ora file is the directory $OKV_HOME/conf.
It is important that the ORACLE_HOME, ORACLE_BASE, and OKV_HOME environment variables are consistently set across the deployment. If they are not consistent, then operations requiring the persistent cache may fail, and the persistent cache may be created in multiple locations.
If the environment variable OKV_HOME is set, then the persistent cache is created in $OKV_HOME/conf.
If OKV_HOME is not set, but ORACLE_BASE is set, then the persistent cache is created in $ORACLE_BASE/okv/$ORACLE_SID.
If neither OKV_HOME nor ORACLE_BASE is set, but ORACLE_HOME is set, then the persistent cache is created in $ORACLE_HOME/okv/$ORACLE_SID.
Note: Ensure that the directory in which the persistent cache is created is secure and has restricted permissions.
Persistent Master Encryption Key Cache Modes of Operation
The persistent master encryption key cache operates in two modes.
The difference between the two modes is the order in which the persistent master encryption key cache and Oracle Key Vault are looked up to retrieve the master encryption key.
-
In Oracle Key Vault first mode, the endpoints attempt to retrieve the master encryption key from the Oracle Key Vault server.
-
Persistent Master Encryption Key Cache First Mode
In persistent master encryption key cache first mode, the endpoints retrieve the master encryption key from the persistent master encryption key cache.
Oracle Key Vault First Mode
In Oracle Key Vault first mode, the endpoints attempt to retrieve the master encryption key from the Oracle Key Vault server.
If the Oracle Key Vault server is offline, then the endpoints attempt to retrieve the master encryption key from the persistent master encryption key cache.
The endpoints must determine the status of the Oracle Key Vault server, and if it is offline, then the endpoints attempt to retrieve the master encryption key from the persistent master encryption key cache. Hence, database operations that require access to master encryption keys will experience a delay.
Persistent Master Encryption Key Cache First Mode
In persistent master encryption key cache first mode, the endpoints retrieve the master encryption key from the persistent master encryption key cache.
If the master encryption key is not available in the persistent master encryption key cache, then the endpoints attempt to retrieve the master encryption key from the Oracle Key Vault server.
The modifications to the master encryption keys on the Oracle Key Vault server are not applied until the key expires in the persistent master encryption key cache.
Persistent Master Encryption Key Cache Refresh Window
The persistent master encryption key cache refresh window helps to extend the availability of the master encryption key.
The refresh window feature of the persistent master encryption key cache enables the database endpoint to make multiple attempts to refresh the expired master encryption key from the Oracle Key Vault server. In that sense, the endpoint waits for the Oracle Key Vault server to be back online for the master encryption key refresh to complete. Meanwhile, if the master encryption key refresh attempt fails, then the keys are retrieved from the persistent cache for the duration of the refresh window.
The refresh window feature of the persistent master encryption key cache therefore extends the duration for which the master encryption key is available after it is cached in the persistent master encryption key cache. At the same time, the endpoints can refresh the key during the refresh window instead of once at the end of the cache time. This addresses the possibility that persistent cache expires during the time when the Oracle Key Vault is unavailable, such as when a primary-standby switchover is in progress. The refresh window terminates and then the cache period begins as soon as the key is refreshed.
In the okvclient.ora file, you can use the PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW parameter to extend the duration for which the master encryption key is available after it is cached in the persistent master encryption key cache. This value reflects the amount of time it takes for the Oracle Key Vault server to recover and return online. You must specify this value in minutes. The default value for PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW is 30 (minutes).
Related Topics
Persistent Master Encryption Key Cache Parameters
Oracle Key Vault provides parameters to configure the persistent master encryption key cache.
-
PKCS11_CACHE_TIMEOUT Parameter
The
PKCS11_CACHE_TIMEOUTparameter sets how long a master encryption key is available in the in-memory cache. -
PKCS11_PERSISTENT_CACHE_TIMEOUT Parameter
The
PKCS11_PERSISTENT_CACHE_TIMEOUTparameter sets how long the master encryption is available in the persistent cache. -
PKCS11_PERSISTENT_CACHE_FIRST Parameter
The
PKCS11_PERSISTENT_CACHE_FIRSTparameter sets the persistent master encryption key cache operation mode. -
PKCS11_CONFIG_PARAM_REFRESH_INTERVAL Parameter
The
PKCS11_CONFIG_PARAM_REFRESH_INTERVALparameter describes the frequency at which a long-running process will re-read theokvclient.oraconfiguration file. -
PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW Parameter
The
PKCS11_PERSISTENT_CACHE_REFRESH_WINDOWparameter extends time the master encryption key is available after it is cached in the persistent master encryption key cache. -
EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN Parameter
The
EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWNparameter ensures that the PKCS#11 persistent cache for a given endpoint database automatically expires upon shutdown of the endpoint database.
PKCS11_CACHE_TIMEOUT Parameter
The PKCS11_CACHE_TIMEOUT parameter sets how long a master encryption key is available in the in-memory cache.
You must specify the value in minutes. When the specified duration of time elapses, the master encryption key expires. Keys are deleted from the in-memory cache.
The default value for PKCS11_CACHE_TIMEOUT is 60 (minutes). The minimum value is 0. The management console accepts values up to 35,791,394 (minutes). Oracle recommends that you set the PKCS11_CACHE_TIMEOUT parameter in the Oracle Key Vault management console.
Related Topics
PKCS11_PERSISTENT_CACHE_TIMEOUT Parameter
The PKCS11_PERSISTENT_CACHE_TIMEOUT parameter sets how long the master encryption is available in the persistent cache.
This time starts when the database retrieves the key from the Oracle Key Vault server and puts it in the cache. After this duration has elapsed, the master encryption key expires. At this time, the endpoint will attempt to contact the Oracle Key Vault server in order to retrieve the key, and if it succeeds, the key remains available for another duration specified by this parameter. If it is unable to retrieve the key, the key remains available for the amount of time dictated by the PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW parameter, after which the database can no longer use the key without successfully retrieving it again from the Oracle Key Vault server. Encryption keys are deleted from persistent master encryption key cache.
The Cache Start Time and Maximum Use Time values displayed in the OKV Persistent Cache entries list is updated when the master encryption key is refreshed.
The default value for PKCS11_PERSISTENT_CACHE_TIMEOUT is 1440 (minutes). The minimum value is 0 (zero). The Oracle Key Vault management console accepts values up to 35,791,394 (minutes).
You can disable the persistent master encryption key cache by setting both the PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW and the PKCS11_PERSISTENT_CACHE_TIMEOUT parameters to 0 (zero).
Oracle recommends that you set this global parameter in the Oracle Key Vault management console.
Note: The parameter PKCS11_PERSISTENT_CACHE_TIMEOUT and its default value are included by default in the okvclient.ora file.
Related Topics
PKCS11_PERSISTENT_CACHE_FIRST Parameter
The PKCS11_PERSISTENT_CACHE_FIRST parameter sets the persistent master encryption key cache operation mode.
You set the PKCS11_PERSISTENT_CACHE_FIRST parameter in the okvclient.ora file.
The following are the modes of operation:
-
Oracle Key Vault First Mode: To enable Oracle Key Vault first mode, set the value of the
PKCS11_PERSISTENT_CACHE_FIRSTparameter to0(zero). -
Persistent Master Encryption Key Cache First Mode: Persistent master encryption key cache first mode is the default mode.
To enable persistent master encryption key cache first mode, set the value of the
PKCS11_PERSISTENT_CACHE_FIRSTparameter to1.
Related Topics
PKCS11_CONFIG_PARAM_REFRESH_INTERVAL Parameter
The PKCS11_CONFIG_PARAM_REFRESH_INTERVAL parameter describes the frequency at which a long-running process will re-read the okvclient.ora configuration file.
This parameter also describes the frequency at which a process will attempt to remove expired master encryption keys from the persistent cache.
When the process cannot use a key from the in-memory cache and instead reaches out to the persistent cache or the Oracle Key Vault server, if it has been longer than the value specified by PKCS11_CONFIG_PARAM_REFRESH_INTERVAL since okvclient.ora was last read, the process will re-read okvclient.ora, start using any changed parameters, re-read the okvclient.ora configuration file, start using any changed parameters, and remove expired master encryption keys from the persistent cache. Note that if the parameter for the in-memory cache and if PKCS11_CACHE_TIMEOUT, is larger than PKCS11_CONFIG_PARAM_REFRESH_INTERVAL, then these operations will be performed at intervals described by the PKCS11_CACHE_TIMEOUT parameter instead.
Oracle recommends that you set the PKCS11_CONFIG_PARAM_REFRESH_INTERVAL parameter in the Oracle Key Vault management console. You must specify this value in minutes. The default value for PKCS11_CONFIG_PARAM_REFRESH_INTERVAL is 10 (minutes). The minimum value is 0. The management console accepts values up to 35,791,394 (minutes).
You can disable this parameter by setting the PKCS11_CONFIG_PARAM_REFRESH_INTERVAL parameter to 0 (zero).
Related Topics
PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW Parameter
The PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW parameter extends time the master encryption key is available after it is cached in the persistent master encryption key cache.
Oracle recommends that you set these global parameters in the Oracle Key Vault management console. You must specify the value in minutes. The default value for PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW is 30 (minutes). The minimum value is 0. The management console accepts values up to 35,791,394 (minutes).
You can disable the persistent master encryption key cache by setting the PKCS11_PERSISTENT_CACHE_REFRESH_WINDOW and PKCS11_PERSISTENT_CACHE_TIMEOUT parameters to 0 (zero).
Related Topics
EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN Parameter
The EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN parameter ensures that the PKCS#11 persistent cache for a given endpoint database automatically expires upon shutdown of the endpoint database.
When enabled, the EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN protects the persistent cache by using a system-generated random password that is independent of the password that was set when an endpoint database was enrolled in Oracle Key Vault, even if an auto-login wallet was used. Having the persistent cache password protected provides better security.
Before you can use the EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN parameter, ensure that the endpoint database has had the patch for bug 29869906: AUTO-LOGIN OKV NEEDS PERSISTENT CACHE PROTECTION KEY FROM RDBMS applied to it. This patch applies to Oracle Database releases
12.1 through 19c. Contact Oracle Support for more information.
You can set EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN for individual endpoint databases that have been enrolled with Oracle Key Vault, or globally for all endpoint databases that have been enrolled in Oracle Key Vault. This parameter is not available in the okvclient.ora configuration file for the database endpoint. To set this parameter, use the Oracle Key Vault management console.
After you have enabled EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN, the PKCS#11 persistent cache is created when keys are fetched from Oracle Key Vault. The cache remains available to the endpoint database only as long as the database instance is mounted or open. When the endpoint database is shut down, the PKCS#11 persistent cache is no longer available, but is recreated the next time the endpoint database is started. The persistent cache does, however, remain available when an endpoint pluggable database (PDB) is closed and then re-opened.
Be aware that after you have enabled EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN for a given endpoint database, you can no longer use the okvutil list -t okv_persistent_cache command to view the contents of the persistent cache. In addition, you must ensure that Oracle Key Vault is available when keys are fetched after the endpoint database is started.
Setting EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN for Individual Endpoint Databases
-
Log in to the Oracle Key Vault management console as a user who has the System Administrator role.
-
Click the Endpoints tab.
-
On the Endpoints page, select the endpoint for which you want to set
EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN. -
On the Endpoint Details page, scroll to the bottom and then set the Expire PKCS11 Persistent Cache on Database Shutdown checkbox.
-
Click Save.
Setting EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN Globally
The following procedure will apply the EXPIRE PKCS11 PERSISTENT CACHE ON DATABASE SHUTDOWN to all current and future endpoint databases that have been enrolled with Oracle Key Vault.
-
Log in to the Oracle Key Vault management console as a user who has the System Administrator role.
-
Select the Endpoints tab, and then Settings from the left side bar.
-
In the Global Endpoint Configuration Parameters page, set the Expire PKCS11 Persistent Cache on Database Shutdown checkbox.
-
Click Save.
Listing the Contents of the Persistent Master Key Cache
The okvutil list command can be used to list the master encryption keys that are cached in the persistent master encryption key cache.
Oracle Key Vault automatically removes master encryption keys that are expired after you run the okvutil list command on the persistent cache.
-
As an endpoint manager, run the
okvutil listcommand, similar to the following example:./okvutil list -t okv_persistent_cache -l -a $ORACLE_HOME/okv/$ORACLE_SID Enter Oracle Key Vault endpoint password: passwordOutput similar to the following appears:
OKV Persistent Cache entries: Current Persistent Cache Timeout is 180 seconds Version Unique ID TDE Master Encryption Key Identifier Cache Start Time Maximum Use Time Maximum Refresh Window Status Cache End Time 04 995340FA-CEF4-4DBD-BA5E-2D51438A0263 06A050A0A111FB4F31BFA78CFF67C3B55E 2025-11-17 15:53:57 UTC 420 seconds 240 seconds Refreshing 2025-11-17 16:00:57 UTC 04 86EBC815-3F3B-402A-96FD-292AC573C914 0603BA32D8C9E94F67BFC1FA485F749493 2025-11-17 15:48:57 UTC 300 seconds 180 seconds Expired 2025-11-17 15:53:57 UTC 04 2AF0DFE4-F0B8-43FE-9F01-F419695C3D9C 06E40EF4FAD1444F5BBFED4460A879CEDF 2025-11-17 15:48:56 UTC 300 seconds 180 seconds Expired 2025-11-17 15:53:56 UTC 04 17564617-167D-4E1F-BF6A-FDD173C3D47D 069A63539522214F6ABF27C761453E3CFB 2025-11-17 15:48:55 UTC 300 seconds 180 seconds Expired 2025-11-17 15:53:55 UTC 04 2C7A13BF-2778-4344-B1EE-9124F2697577 062708F607E52B4F4CBFD8D9DD18828B8E 2025-11-17 15:48:54 UTC 300 seconds 180 seconds Expired 2025-11-17 15:53:54 UTC 04 DB0B687D-0236-40ED-BD06-8C95D9DAC13B 063A6A1274C9BE4F52BFC2063C77B3E21F 2025-11-17 15:56:57 UTC 420 seconds 240 seconds Available 2025-11-17 16:03:57 UTCThe following table describes the columns in the
OKV Persistent Cache entrieslist:Column Name Description VersionPersistent master encryption key cache version. Unique IDKMIP identifier assigned to the master encryption key. TDE Master Key IdentifierDatabase ID assigned to the master encryption key. Cache Start TimeLocal time at which the master encryption key was cached. Maximum Use TimeTime until the master encryption key expires, in seconds, from the moment that the key was placed into the persistent master encryption key cache. Maximum Refresh WindowExtended duration for which the master encryption key is available after it is cached in the persistent master encryption key cache StatusIndicates whether the master encryption key is available, refreshing or expired. Cache End TimeThe local time at which the master encryption key expires. The
Cache End Timeis determined by adding thePKCS11_PERSISTENT_CACHE_TIMEOUTandPKCS11_PERSISTENT_CACHE_REFRESH_WINDOWdurations to theCache Start Timeof the key.This value is displayed only when the
-aoption is specified in the command.
Oracle Database Deployments and Persistent Master Encryption Key Cache
The persistent master encryption key cache affects the integration of other Oracle features with Oracle Key Vault.
-
Database restart when the Oracle Key Vault Server is offline: When you configure Oracle Key Vault to use an auto-login wallet, the database connects to the Oracle Key Vault server when the database is restarted. If the Oracle Key Vault server is offline when the database restarts, then the database retrieves master encryption keys from the persistent master encryption key cache. Database operations resume normally if the master encryption keys are active and have not expired.
Ensure that the passwords of the persistent master encryption key cache and the Oracle Key Vault endpoint wallet are synchronized.
Note: The persistent master encryption key cache must be deleted when the endpoint wallet credentials are modified.
-
Using the persistent master encryption key cache in an Oracle Real Application Cluster (Oracle RAC) environment: In an Oracle RAC environment, each Oracle RAC node is an unique database endpoint, and uses a unique persistent master encryption key cache.
In an Oracle RAC Environment, you must query the database from each Oracle RAC node to cache the most recent version of the master encryption key in the persistent master encryption key cache of each Oracle RAC node.
-
Using persistent master encryption key cache in an Oracle Data Guard Environment: Rotation of the master encryption key in the primary server’s database caches the master encryption key in the persistent master encryption key cache of the primary server’s database.
The standby server retrieves and caches the new master encryption key in the persistent master encryption key cache of the standby server’s database after the new
REDOlogs from the primary server are applied on the standby server. To avoid disruptions, you should synchronize the primary and standby servers immediately after the rotation of the master encryption key in the primary server’s database.
Configuring an Oracle Key Vault to a New TDE-Enabled Database Connection
You can configure a connection between Oracle Key Vault and a database that has not yet been configured for Transparent Data Encryption.
-
About Configuring an Oracle Key Vault to a New TDE-Enabled Database Connection
You can configure a connection between Oracle Key Vault and a database that has not yet been configured for TDE.
-
Limitations to Transparent Data Encryption Endpoint Integration
This type of Transparent Data Encryption (TDE) endpoint integration can have problems if the versions are incompatible.
-
Step 1: Configure the Oracle Key Vault Server Environment
Before you can configure the connection, you must ensure that Oracle Database and Oracle Key Vault settings are correct.
-
Step 2: Integrate Transparent Data Encryption with Oracle Key Vault
This integration enables Oracle Key Vault to directly manage the TDE master encryption keys.
About Configuring an Oracle Key Vault to a New TDE-Enabled Database Connection
You can configure a connection between Oracle Key Vault and a database that has not yet been configured for TDE.
Before you start configuring the connection, ensure that the Oracle Key Vault client installation environment is the same as the database runtime environment. The environment variables ORACLE_HOME, ORACLE_BASE, and ORACLE_SID must be set to the same values in svrctl and operating system environment variables. This also applies if you are using the Oracle Key Vault RESTful services utility to enroll endpoints.
For information about configuring Oracle Data Guard so that it can work with TDE and Oracle Key Vault:
-
Oracle Database Advanced Security Guide, release 19c
-
Oracle Database Advanced Security Guide, release 18c
-
Oracle Database Advanced Security Guide, release 12.2.0.1
For information about configuring Oracle Real Application Clusters (Oracle RAC) to work with TDE and Oracle Key Vault:
-
Oracle Database Advanced Security Guide, release 19c
-
Oracle Database Advanced Security Guide, release 18c
-
Oracle Database Advanced Security Guide, release 12.2.0.1
For more information on the steps to clone PDB when PDB keys are stored in Oracle Key Vault, see in ASO admin guide:
Limitations to Transparent Data Encryption Endpoint Integration
This type of Transparent Data Encryption (TDE) endpoint integration can have problems if the versions are incompatible.
The limitations to TDE endpoint integration are as follows:
-
For Oracle Database release 21c and earlier, all endpoints on the same computer must use the same version of the Oracle Key Vault library. On each computer, the
liborapkcs.sofile is in the path/opt/ oracle/expapi/64/hsm/oracle/1.0.0/liborapkcs.so. -
For Oracle Database release 26ai, each endpoint can use a different version of the Oracle Key Vault library. Oracle database loads the
PKCS#11library which is specific to the endpoint version. Oracle Key Vault installs theliborapkcs.sofile in a fixed custom path when theroot.shscript is invoked with the--okv_pkcs11_library_locationoption. After the new library is installed, the database can use the new library by setting the database initialization parameterPKCS11_LIBRARY_LOCATIONor running theADMINISTER KEY MANAGEMENT SWITCHOVERcommand to start using the updated library. -
If you have multiple databases on the same host, and those databases share the same
sqlnet.orafile, then you must migrate all databases at the same time. If each database has its ownsqlnet.orafile (controlled by individual settings for theTNS_ADMINparameter), then you can migrate the databases into Oracle Key Vault at independent points in time.
Caution:
Oracle strongly recommends that you never remove keys from a wallet or the wallet itself after TDE is configured. Loss of keys will result in the loss of the database. This is true even in the following scenarios:
-
If you had created or opened a keystore (wallet or Oracle Key Vault), even before setting the first key and before encrypting data in your database
-
If all of the encrypted data has been decrypted
-
If you have migrated your keys and wallets to a hardware security module
Step 1: Configure the Oracle Key Vault Server Environment
Before you can configure the connection, you must ensure that Oracle Database and Oracle Key Vault settings are correct.
These settings include Oracle environment variables and the Oracle COMPATIBILITY parameter.
-
Log in to the server where the database endpoint is installed.
-
Ensure that the
ORACLE_BASEenvironment variable is set for the current operating system session, as well as insrvctlfor Oracle Real Application Clusters (Oracle RAC)-enabled databases, before you start the database.This step is very important. If the
ORACLE_BASEenvironment variable is not present, then create a soft link from the$ORACLE_BASE/okv/$ORACLE_SID/okvclient.orafile to the key_vault_endpoint_installation_dir/conf/okvclient.orafile. In an Oracle Real Application Clusters environment, you must perform this step on all database instances. -
Ensure that the
COMPATIBILITYinitialization parameter is set to12.1.0.0or later. -
Enroll and provision the endpoint for the Transparent Data Encryption (TDE)-enabled database that contains the TDE data.
When you initially enroll the endpoint, select
ORACLE_DBas the endpoint type for integration with TDE. -
Ensure that the endpoint has access to the virtual wallet that you want to use by defining the wallet as the default wallet for that endpoint.
In Oracle RAC and Oracle Data Guard environments, the endpoints of all primary and standby instances share the same default wallet.
-
Depending on the Oracle Database release, configure the encryption wallet location.
-
For Oracle Database release 12.1.0.2, configure the
sqlnet.orafile on this database to point to Oracle Key Vault as follows:ENCRYPTION_WALLET_LOCATION=(SOURCE=(METHOD=HSM)) -
For Oracle Database release 12.2.0.1, configure the
sqlnet.orafile on this database to point to Oracle Key Vault as follows:ENCRYPTION_WALLET_LOCATION=(SOURCE=(METHOD=OKV))By default, the
sqlnet.orafile is located in the ORACLE_HOME**/network/admindirectory or in the location set by theTNS_ADMINenvironment variable. -
For Oracle Database release 18c or later, configure the following parameters:
-
Set
WALLET_ROOTto define the installation directory of the Oracle Key Vault client. The directory that will be defined asWALLET_ROOTmust have the following sub-directories (in lower case) in order for the database to auto-discover the correct keystore configuration:-
/okv: The Oracle Key Vault client software is installed into this directory. -
/tde: The TDE wallet (or the auto-open wallet for Oracle Key Vault) goes into this sub directory. -
/tde_seps: This directory is for a wallet that will hide the keystore password (wallet or Oracle Key Vault) from theADMINISTER KEY MANAGEMENTcommand when theEXTERNAL STOREclause is used to replace the password.
-
-
Set
TDE_CONFIGURATIONtoOKVfor Oracle Key Vault, orOKV|FILEfor an auto-open connection into Oracle Key Vault.
Endpoints use the PKCS#11 library support to manage TDE master encryption keys. Run the
root.shscript (in theokvclient_installation_directory/bindirectory) to deploy the PKCS#11 library that facilitates the communication between the endpoint and Oracle Key Vault.At this stage, the Oracle Database will use Oracle Key Vault for centralized key management. For all TDE commands and statements, use the Oracle Key Vault endpoint password that was specified during the installation of the endpoint software, unless the keystore password is hidden from the
ADMINISTER KEY MANAGEMENTcommands in a wallet that was created in theWALLET_ROOT/tde_sepsdirectory. -
-
-
Reconnect to the database if you are in SQL*Plus.
The changes will appear after you log out of the current SQL*Plus session and then connect again.
-
Query the
V$ENCRYPTION_WALLETdynamic view to ensure that theMETHOD_DATAsetting in thesqlnet.ora filechanged.SELECT * FROM V$ENCRYPTION_WALLET;The output of the query should now show
OKV. -
Configure the Extractable attribute value for the TDE master encryption key.
This setting determines whether the symmetric key can be retrieved (extracted) from Oracle Key Vault during certain operations.
As a user who has the Key Administrator role, you can set the default value of the Extractable attribute for the new symmetric key in the Endpoint Settings for Keys and Secrets page. Per-endpoint setting, if any, overrides the global endpoint setting. You can also set this attribute value explicitly at the time of creating or registering a new symmetric key (using the C or JAVA SDK, or the RESTful services utility). However, this is subject to an additional restriction: You cannot set the extractable attribute of a new symmetric key to TRUE (that is, create the new key as extractable) if the effective endpoint setting for the extractable attribute is set to FALSE (that is, the new symmetric key are not extractable). As a user who has the Key Administrator role, you can modify the extractable attribute setting of an existing symmetric key to either TRUE or FALSE. A user or an endpoint with read/write access on an existing symmetric key can also modify its extractable attribute setting, however, this is allowed only to apply the stricter setting, that is, to set the value to FALSE to make the object non-extractable. Such users or endpoints cannot modify the Extractable attribute setting to make a symmetric key extractable if it is currently non-extractable.
The TDE configuration is complete at this stage. You can now encrypt existing table spaces or create new encrypted table spaces in the database. Oracle does not recommend using TDE column encryption with any external key manager. If you have configured the sqlnet.ora file correctly along with the rest of the TDE configuration, then a TDE master encryption key is created in Oracle Key Vault when you set the encryption key by using one of the following SQL statements:
-
ALTER SYSTEM SET [ENCRYPTION] KEY IDENTIFIED BY "password"; -
ADMINISTER KEY MANAGEMENT SET [ENCRYPTION] KEY IDENTIFIED BY "password"
With both of these SQL statements, the password was defined when the Oracle Key Vault client software was installed. If no password was defined at that time, then the password for these two statements is NULL.
Related Topics
Step 2: Integrate Transparent Data Encryption with Oracle Key Vault
This integration enables Oracle Key Vault to directly manage the TDE master encryption keys.
-
Ensure that you are logged in to the server where Oracle Key Vault client is installed.
Note:
Consider the following points when executing the
root.shscript:For Oracle Database release 21c and earlier:
-
You must run
root.shto install the Oracle Key Vault library only once on a host with multiple Oracle databases. -
Ensure that you execute the
root.shscript only after installation of Oracle Key Vault clients for all TDE-enabled databases on the same host is complete. -
Ensure that all Oracle databases on this host are shut down.
For Oracle Database release 26ai:
-
Oracle recommends to install the PKCS#11 library by passing the
--okv_pkcs11_library_locationoption to theroot.shscript. This option enables Oracle Key Vault to install the PKCS#11 library in the fixed custom path which is different from the legacy location. The custom path is in the format/opt/oracle/extapi/64/pkcs11/okv//lib.
For example, for the Oracle Key Vault 21.XX release, the path is/opt/oracle/extapi/64/pkcs11/okv/21.XX.0.0.0/lib. -
Run the
root.shscript once for each different endpoint software version in the same host. -
All Oracle databases in this host need not be shut down as the
--okv_pkcs11_library_locationinstalls thePKCS#11library in a new path for each endpoint release.
-
-
Shut down the database server.
This script implements the persistent master encryption key cache feature in the Oracle Key Vault PKCS#11 library, which improves the availability of the database during intermittent network disruptions or Oracle Key Vault upgrade.
-
UNIX: The root script copies the PKCS#11 library into
/opt/oracle/extapi/64/hsm/oracle/1.0.0and minimizes the file access privileges. -
Windows: Run the
root.batscript to copy theliborapkcs.dllfile (located in thelibdirectory) to theC:\oracle\extapi\64\hsm\oracle\1.0.0directory. Provide the database version when prompted.
-
-
For Oracle Database release 21c and earlier, shut down the database server.
-
UNIX: The root script copies the
PKCS#11library into the/opt/oracle/extapi/64/hsm/ oracle/1.0.0path and minimizes file access privileges. If--okv_pkcs11_library_locationis specified, then the script copies thePKCS#11library into the/opt/oracle/extapi/64/pkcs11/okv/21.XX.0.0.0/libpath, where 21.XX.0.0.0 is the Oracle Key Vault Endpoint software version. -
Windows: Run the
root.batscript to copy theliborapkcs.dllfile (located in the lib directory) to theC:\oracle\extapi\64\hsm\oracle\1.0.0directory. Provide the database version when prompted.For Oracle Database release 26ai and later, Oracle recommends to install the
PKCS#11library in the custom location. Shut down the database server if thePKCS#11library is being installed in the/opt/oracle/extapi/64/hsm/ oracle/1.0.0legacy path. -
UNIX: If
--okv_pkcs11_library_locationis specified with theroot.shscript, then thePKCS#11library is copied into the/opt/oracle/extapi/64/pkcs11/okv/21.XX.0.0.0/libpath, where 21.XX.0.0.0 is the Oracle Key Vault Endpoint software version.Run the root script from the
okvclient_installation_directory/binpath.
-
-
Start the Oracle database.
For Oracle Database release 26ai:
Perform the following additional steps in the database. These steps are needed for the database to start using the PKCS#11 library from the custom path and also to transition the database to upgrade the liborapkcs.so file without encountering downtime in future.
-
Log in to the CDB root as a user who has been granted the
ALTER SYSTEMprivilege -
As a user with the
ALTER SYSTEMprivilege, set the static initialization parameterPKCS11_LIBRARY_LOCATIONto point to the upgradedliborapkcs.sofile. For example:ALTER SYSTEM SET PKCS11_LIBRARY_LOCATION = '/opt/oracle/extapi/64/ pkcs11/okv/21.16.0.0.0/lib/liborapkcs.so' SCOPE = SPFILE SID = '*';After a database restart, your database is now ready to switch to new PKCS#11 libraries without database downtime.
After you upgrade Oracle Key Vault to a new release (for example 21.XX.0.0.0), the
root.shscript in the upgraded endpoint can be used to copyliborapkcs.soto the new path/opt/oracle/extapi/64/pkcs11/okv/21.16.0.0.0/lib. The database can switchover to the new library using theSWITCHOVERcommand without any downtime. For example:ADMINISTER KEY MANAGEMENT SWITCHOVER TO LIBRARY '/opt/oracle/extapi/64/pkcs11/okv/21.16.0.0.0/lib/liborapkcs.so' FOR ALL CONTAINERSFor example,
ADMINISTER KEY MANAGEMENT SWITCHOVER TO LIBRARY '/opt/oracle/extapi/64/pkcs11/okv/21.16.0.0.0/lib/liborapkcs.so' FOR ALL CONTAINERS -
-
For password-protected wallets on the database, open the wallet. (Auto-login wallets are automatically opened.)
-
For Oracle Database release 12.1.0.2 or later: As a user who has been granted the
SYSKMadministrative privilege:ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "Oracle_Key_Vault_endpoint_password";
-
-
Set the master encryption key.
-
For Oracle Database release 12.1.0.2 or later:
ADMINISTER KEY MANAGEMENT SET [ENCRYPTION] KEY IDENTIFIED BY "Oracle_Key_Vault_endpoint_password" WITH BACKUP;
-
Related Topics
Migrating Existing TDE Wallets to Oracle Key Vault
A migrated TDE wallet can be used to restore database contents that were previously encrypted by TDE.
-
About Migrating Existing TDE Wallets to Oracle Key Vault
The
sqlnet.orafile enables the migration of existing TDE wallets to Oracle Key Vault. -
Migrating an Existing TDE Wallet to Oracle Key Vault
You can use the
okvutil uploadcommand to start the migration of a TDE-enabled database from an existing TDE wallet to Oracle Key Vault. -
Restoring Database Contents Previously Encrypted by TDE Using an Oracle Wallet
You perform the restoration process on the endpoint where you downloaded the Oracle wallet.
About Migrating Existing TDE Wallets to Oracle Key Vault
The sqlnet.ora file enables the migration of existing TDE wallets to Oracle Key Vault.
For Oracle Database release 12.2.0.1 or earlier, the sqlnet.ora file enables the migration of existing TDE wallets to Oracle Key Vault. For Oracle Database release 18c or later, you must set the parameters TDE_CONFIGURATION and WALLET_ROOT to migrate wallets to Oracle Key Vault.
When the Transparent Data Encryption (TDE) wallets already exist, you must modify the sqlnet.ora file or the TDE_CONFIGURATION parameter to recognize Oracle Key Vault before you can migrate the existing TDE wallets to Oracle Key Vault.
Along with the current TDE master encryption key, Oracle wallets maintain historical TDE master encryption keys that are replaced by each rekey operation that rotates the TDE master encryption key. These historical TDE master encryption keys help to restore Oracle Database backups that were previously made using one of the historical TDE master encryption keys. During the TDE migration from an Oracle wallet file to Oracle Key Vault, Key Vault generates new master encryption keys. After this master encryption key generation, Oracle Key Vault maintains all new keys.
Oracle recommends that you upload the Oracle wallet to Oracle Key Vault before you perform the migration. This enables you to keep a backup of the wallet with all of the historical key information, before you begin the migration. When the migration is complete, manually delete the old wallet on the client system.
If you are operating on an Oracle Real Application Clusters (Oracle RAC) configuration, ensure that you migrate from a shared TDE wallet (in Oracle Automatic Storage Management (Oracle ASM) or Oracle Advanced Cluster File System (Oracle ACFS)) to Oracle Key Vault. Individual wallets for each Oracle RAC node are not supported.
Related Topics
-
Migrating Between a Software Password Keystore and an External Keystore
-
Restoring Database Contents Previously Encrypted by TDE Using an Oracle Wallet
-
Configuring the Extractable Attribute Value of Existing Symmetric or Private Keys
Migrating an Existing TDE Wallet to Oracle Key Vault
You can use the okvutil upload command to start the migration of a TDE-enabled database from an existing TDE wallet to Oracle Key Vault.
-
Back up the database that you want to migrate.
-
Complete the enrollment of the endpoint.
-
If you have not done so already, then use the
okvutil uploadcommand to upload current and historical master encryption keys from the TDE wallet into the virtual wallet in Oracle Key Vault.OKV_HOME/bin/okvutil upload -t WALLET -l /path/to/tde-wallet -g name_of_wallet_in_Oracle_Key_Vault -v 4This step allows you to delete the wallet after a successful migration, which is often a requirement of security policies that do not allow encryption keys on the encrypting server.
Be aware that the Extractable attribute setting for the objects that are created in Oracle Key Vault using
okvutil uploadis inherited from the endpoint. You can download the wallet, but if the wallet’s objects have the Extractable attribute set toFALSE, then those objects cannot be downloaded. -
Configure the wallet location.
-
For Oracle Database release 12.2.0.1 or earlier: Edit the
METHODsetting of the Oracle Databasesqlnet.orafile for the migration to Oracle Key Vault:ENCRYPTION_WALLET_LOCATION=(SOURCE=(METHOD=OKV)(METHOD_DATA=(DIRECTORY=/path/to/tde-wallet)))By default, the
sqlnet.orafile is located in the ORACLE_HOME/network/admindirectory or in the location set by theTNS_ADMINenvironment variable. -
For Oracle Database release 18c or later: Set the
TDE_CONFIGURATIONparameter.ALTER SYSTEM SET TDE_CONFIGURATION = "KEYSTORE_CONFIGURATION=OKV|FILE" SCOPE = BOTH;The
WALLET_ROOTparameter is already set, so you do not need to change it.
-
-
Reconnect to the database instance (or restart an Oracle RAC database) to capture the changes in the
sqlnet.orafile.If you are reconnecting to the database instance, then changes to the
TDE_CONFIGURATIONparameter in Oracle Databae 18c or later are applied immediately, and no restart is necessary. -
Query the
V$ENCRYPTION_WALLETdynamic view to ensure that theMETHOD_DATAsetting in thesqlnet.ora filechanged.SELECT CON_ID, WALLET_TYPE, WALLET_ORDER, STATUS FROM V$ENCRYPTION_WALLET WHERE CON_ID <> 2;The output of the query should now show
METHOD=OKV. -
If the endpoint is a an Oracle Release 11g release 2 database, then close the local Oracle wallet and open the HSM wallet as follows:
-
Close the local Oracle wallet using these steps:
a. Close the local Oracle wallet as follows:
If the auto-login wallet is open, run the following commands: <pre class="copy"><code>cd /path/to/tde-wallet mv cwallet.sso cwallet.sso.bak sqlplus sys as sysdba Enter password: password SQL> ALTER SYSTEM SET WALLET CLOSE;</code></pre> If the password-protected wallet is open, then run the following statement in SQL*Plus: <pre class="copy"><code>ALTER SYSTEM SET WALLET CLOSE IDENTIFIED BY "wallet_password";</code></pre>b. In SQL*Plus, open the connection into Oracle Key Vault, where
Oracle_Key_Vault_passwordis the password that was provided when theokvclient.jarfile was installed:<pre class="copy"><code>ALTER SYSTEM SET WALLET OPEN IDENTIFIED BY "Oracle_Key_Vault_password";</code></pre> -
Migrate from TDE wallets to Oracle Key Vault.
-
For Oracle Database 11g release 2: If you entered a password for the wallet while installing the endpoint client software, then in SQL*Plus, run this statement:
ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY "Oracle_Key_Vault_password" MIGRATE USING "wallet_password";If you chose the auto-login option while installing the endpoint client software, then run this statement:
ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY "NULL" MIGRATE USING "wallet_password"; -
For Oracle Database 12c or later: As a user who has been granted the
SYSKMadministrative privilege:ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY IDENTIFIED BY "Oracle_Key_Vault_password" MIGRATE USING "wallet_password" WITH BACKUP;Though the
WITH BACKUPclause is required for theADMINISTER KEY MANAGEMENTstatement, it is ignored by TDE in Oracle Key Vault.
-
-
Open the wallet.
-
For Oracle Database 11g release 2: If the endpoint requires a password to connect to Oracle Key Vault, then enter the password.
ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "Oracle_Key_Vault_endpoint_password"; -
For Oracle Database 12c or later:
ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "Oracle_Key_Vault_endpoint_password";
-
-
After you complete the migration, if you are using an auto-login wallet, then re-enable it by renaming the
cwallet.sso.bakfile tocwallet.sso.
Related Topics
Restoring Database Contents Previously Encrypted by TDE Using an Oracle Wallet
You perform the restoration process on the endpoint where you downloaded the Oracle wallet.
When an Oracle database endpoint is converted from a local Oracle wallet file to using Oracle Key Vault, you may need to restore backups that were encrypted by using a key from this local wallet file.
In this case, you must download the necessary key from Oracle Key Vault to a local wallet file to be used when you decrypt the backup during the restore process. For example, suppose that the Finance_DB database had recently migrated to use an online master encryption key to Oracle Key Vault after you have uploaded the premigration wallet. If a system failure forces you to restore from a database backup taken before the migration to Oracle Key Vault, then you can still restore the contents of the database by using an Oracle wallet downloaded from the Oracle virtual wallet that contains the Finance_DB wallet data that you had uploaded earlier.
-
As an endpoint manager, download this Oracle wallet from Oracle Key Vault by using the
okvutil downloadcommand. -
On the endpoint where you downloaded the Oracle wallet, edit the
sqlnet.orafile to have the following setting:ENCRYPTION_WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=wallet_file_path)))Put the
ENCRYPTION_WALLET_LOCATIONsetting on one line. -
Open the downloaded wallet using the password you specified.
-
For Oracle Database 11g release 2, as a user who has been granted the
ALTER SYSTEMsystem privilege:ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "wallet_password"; -
For Oracle Database 12c or later, as a user who has been granted the
SYSKMadministrative privilege:ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "wallet_password";
Opening the wallet enables the server to read the contents of the updated
sqlnet.orafile. At this point, the endpoint server has been restored to a state where it now can run with the original version of the wallet. -
Related Topics
Uploading and Downloading Oracle Wallets
To store and share Oracle wallets, you must upload them to Oracle Key Vault.
-
About Uploading and Downloading Oracle Wallets
You use the
okvutilutility to upload and download Oracle wallets. -
The
okvutil uploadcommand uploads wallets to Oracle Key Vault. -
The
okvutil downloadcommand downloads an Oracle wallet from the Oracle Key Vault server to an endpoint. Perform the following steps as an endpoint manager. -
Guidelines for Uploading and Downloading Oracle Wallets
Oracle provides guidelines for uploading and downloading wallets to and from Oracle Key Vault.
About Uploading and Downloading Oracle Wallets
You use the okvutil utility to upload and download Oracle wallets.
After you upload a wallet to Oracle Key Vault, you can then create a new virtual wallet in Key Vault, and add security objects to it that you want to share. You must grant endpoints access to the virtual wallet before they can download it. You can use the okvutil upload and okvutil download commands to upload and download Oracle wallets between Oracle Key Vault and its endpoints. The okvutil utility is packaged with the endpoint software that you install at the endpoint.
The Oracle Key Vault okvutil software can read an Oracle wallet at the granularity level of an individual security object, and it supports security objects up to 128 KB in size. It therefore uploads the wallet contents as individual items. During download you can recreate the original wallet with the same set of security objects, or create a new wallet with different set of security objects.
You can upload and download both password-based wallets and auto-login wallets. The wallet contents can be downloaded later into a new wallet of either type. For example, an uploaded password-protected wallet can be downloaded as an auto-login wallet, or an uploaded auto-login wallet can be downloaded as a password-protected wallet.
You can use Oracle Key Vault to construct a new virtual wallet containing security objects from previously uploaded Oracle wallets. For example, given a previously uploaded Oracle wallet containing five symmetric keys and three opaque objects, you can create a new virtual wallet consisting of only three of the original five symmetric keys and one of the three original opaque objects. This virtual wallet can be downloaded like the original wallet to provide the endpoint with access to only a subset of the keys. This process does not modify the original wallet.
Be aware that the Extractable attribute setting for the objects that are created in Oracle Key Vault using okvutil upload is inherited from the endpoint. You can download the wallet, but if the wallet’s objects have the Extractable attribute set to FALSE, then those objects cannot be downloaded.
Related Topics
Uploading Oracle Wallets
The okvutil upload command uploads wallets to Oracle Key Vault.
Uploading the contents of a TDE wallet into Oracle Key Vault is a unique feature of Oracle Key Vault: If you plan to migrate the database to use Oracle Key Vault in online master encryption key mode then you must upload the wallet content before the migration step. That allows you to delete the file-based wallet after a successful migration from the database server, which is a requirement of the PCI-DSS. The upload operation uploads everything in the Oracle wallet, including security objects and their metadata so that the wallet can be reconstructed during the download process. The Oracle wallet typically contains TDE master encryption keys, historical TDE master encryption keys, SSL or TLS certificates and their metadata (stored in Oracle Key Vault as opaque objects), wallet metadata, as well as keys that you have explicitly added. Be aware that the Extractable attribute setting for the objects that are created in Oracle Key Vault using okvutil upload is inherited from the endpoint.
-
Ensure that the server containing the Oracle wallet has been enrolled and provisioned as an Oracle Key Vault endpoint.
-
Ensure that the endpoint has access to the virtual wallet that you want to use.
The endpoint must have read, modify, and manage wallet access to the virtual wallet in Oracle Key Vault.
-
As an endpoint manager, run the
okvutil uploadcommand to upload the wallet.For example:
# okvutil upload -l /etc/oracle/wallets -t wallet -g HRWallet Enter wallet password (<enter> for auto-login): password Enter Oracle Key Vault endpoint password: Key_Vault_endpoint_password Upload succeeededIn this example:
-
-lspecifies the directory location of the wallet that you are uploading. -
-tindicates the type, in this case, an Oracle wallet. -
-gspecifies the Oracle Key Vault virtual wallet that was configured in Step 2, so that this wallet can be part of that virtual wallet.
-
At this point, the upload is complete. You can now share the virtual wallet with other users and endpoints.
Related Topics
Downloading Oracle Wallets
The okvutil download command downloads an Oracle wallet from the Oracle Key Vault server to an endpoint. Perform the following steps as an endpoint manager.
-
Ensure that security objects in the wallet have an extraction status of
TRUE.If the object has Extractable attribute setting of
FALSE, then you cannot download it. You can check the Extractable attribute setting by navigating to the Object Details page. Select the Keys & Wallets tab, then in the left navigation bar, select Keys & Secrets, then for the key listed, select the Edit icon. The Extractable attribute setting is listed in the Advanced section. -
Ensure that the endpoint has Read access on the virtual wallet that you want to download.
-
Run the
okvutil downloadcommand to download the wallet.For example:
# okvutil download -l /etc/oracle/wallets/orcl/ -t WALLET -g HRwallet Enter new wallet password(<enter> for auto-login): Oracle_wallet_password Confirm new wallet password: Oracle_wallet_password Enter Oracle Key Vault endpoint password: Key_Vault_endpoint_passwordIn this example:
-
-lis the location of the wallet to be created. -
-tindicates the type, in this case, an Oracle wallet. -
-gspecifies the Oracle Key Vault virtual wallet that was configured in Step 2.
If the wallet already exists and you did not use the
-oparameter to overwrite the existing wallet, then the following actions take place:-
The existing wallet is renamed to a backup name of the format
ewallet.p12.current_timestamp where the timestamp is number of seconds since epoch. -
The newly downloaded wallet is given the name
ewallet.p12.
-
-
Close and then reopen the wallet.
Closing and reopening the wallet makes the wallet content, including TDE master encryption keys, available on a database encrypted with TDE, and loads the wallet contents into the TDE database. (Auto-login wallets are automatically opened the next time that they are accessed.)
-
For Oracle Database 11g release 2:
ALTER SYSTEM SET ENCRYPTION WALLET CLOSE IDENTIFIED BY "Oracle_wallet_password"; ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "Oracle_wallet_password"; -
For Oracle Database 12c or later:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY "Oracle_wallet_password"; ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "Oracle_wallet_password";
-
-
If you are operating in a shared server configuration such as Oracle RAC, then restart the database.
Related Topics
-
Granting Access to Users, User Groups, Endpoints, and Endpoint Groups
-
Configuring the Extractable Attribute Value of Existing Symmetric or Private Keys
Guidelines for Uploading and Downloading Oracle Wallets
Oracle provides guidelines for uploading and downloading wallets to and from Oracle Key Vault.
-
If there is a change to the content of the original wallet, such as a key rotation or a rekey operation, then upload the wallet again to Oracle Key Vault so that Key Vault has the latest copy of the wallet.
-
Use care if you plan to use the
okvutil uploadandokvutil downloadcommands, which provide an overwrite (-o) option. This option overwrites data in the virtual wallet that conflicts with the data to be uploaded. Before you use the-ooption, you should create a local backup of the wallet file. -
Do not try to upload the same physical Oracle wallet to more than one virtual wallet on the Oracle Key Vault server. If you want to share an Oracle wallet with multiple endpoints, then create an endpoint group.
Related Topics
Uploading and Downloading JKS and JCEKS Keystores
The okvutil upload and okvutil download commands can upload and download JKS and JCEKS keystores.
-
About Uploading and Downloading JKS and JCEKS Keystores
You use the
okvutilutility to upload and download JKS and JCEKS keystores. -
Uploading JKS or JCEKS Keystores
The
okvutil uploadcommand can upload a JKS or JCEKS to the Oracle Key Vault server. -
Downloading JKS or JCEKS Keystores
The
okvutil downloadcommand can download an uploaded JKS or JCEKS keystore. -
Guidelines for Uploading and Downloading JKS and JCEKS Keystores
Oracle provides recommendations for when you upload and download JKS and JCEKS keystores.
About Uploading and Downloading JKS and JCEKS Keystores
You use the okvutil utility to upload and download JKS and JCEKS keystores.
You can upload JKS and JCEKS keystores to Oracle Key Vault for long-term retention, recovery, and sharing, and when you need them, download them to an endpoint.
Similar to wallets, when you upload a JKS or JCEKS keystore, Oracle Key Vault can read each item within the keystore. It uploads the keystore contents as individual items, and it supports an item up to 128 KB in size.
Be aware that the Extractable attribute setting for the objects that are created in Oracle Key Vault using okvutil upload is inherited from the endpoint. You can download the JKS and JCEKS keystore, but if this keystore’s objects have the Extractable attribute set to FALSE, then those objects cannot be downloaded.
Related Topics
Uploading JKS or JCEKS Keystores
The okvutil upload command can upload a JKS or JCEKS to the Oracle Key Vault server.
Be aware that the Extractable attribute setting for the objects that are created in Oracle Key Vault using okvutil upload is inherited from the endpoint. You can download the JKS and JCEKS keystore, but if this keystore’s objects have the Extractable attribute set to FALSE, then those objects cannot be downloaded.
-
Ensure that the server containing the Java keystore has been enrolled and provisioned as an Oracle Key Vault endpoint.
-
Ensure that access control has been configured for the endpoint.
If you are uploading the keystore to a virtual wallet, then ensure that the endpoint has the read, modify, and manage wallet access to this virtual wallet.
-
As an endpoint manager, run the
okvutil uploadcommand to upload the keystore.The following examples show how to upload the JKS and JCEKS keystore to a virtual wallet.
This example shows how to upload a JKS keystore:
# okvutil upload -l /etc/oracle/fin_jks.jks -t JKS -g FinanceGrp Enter source Java keystore password: Java_keystore_password Enter Oracle Key Vault endpoint password: Key_Vault_endpoint_password Upload succeededIn this example:
-
-lis the location of the Java keystore that is being uploaded. -
-tis the type of JKS or JCEKS keystore. Ensure that you upload the correct type of Java keystore when you upload or later on, when you download. -
-gis the virtual wallet in Oracle Key Vault where the Java keystore contents will be uploaded.
This example shows how to upload a JCEKS keystore:
# okvutil upload -l /etc/oracle/hr_jceks.jceks -t JCEKS -g HRGrp Enter source Java keystore password: password Enter Oracle Key Vault endpoint password: password Upload succeeded -
At this point, the upload is complete. You are now ready to share or download the Java keystore as needed.
Related Topics
Downloading JKS or JCEKS Keystores
The okvutil download command can download an uploaded JKS or JCEKS keystore.
-
Ensure that security objects in the JKS or JCEKS keystore have an Extractable attribute setting of
TRUE.If the object has Extractable attribute setting of
FALSE, then you cannot download it. You can check the Extractable attribute setting by navigating to the Object Details page. Select the Keys & Wallets tab, then in the left navigation bar, select Keys & Secrets, then for the key listed, select the Edit icon. The Extractable attribute setting is listed in the Advanced section. -
Ensure that the endpoint has the read access on the virtual wallet that you want to download.
-
As an endpoint manager, from the command line, run the
okvutil downloadcommand to download the Java keystore.For example:
# okvutil download -l /etc/oracle/new_java_files/hr_jceks.jceks -t JCEKS -g HRGrp Enter new Java keystore password: password Confirm new Java keystore password: password Enter Oracle Key Vault endpoint password: Key_Vault_endpoint_passwordIn this example:
-
-lis the directory to which you want to download the uploaded Java keystore. -
-tis the type of JKS or JCEKS keystore. Ensure that you download the correct type of Java keystore. -
-gis the name of the object to download, which in this case is the JKS keystoreHRGrp.
-
Related Topics
-
Granting Access to Users, User Groups, Endpoints, and Endpoint Groups
-
Configuring the Extractable Attribute Value of Existing Symmetric or Private Keys
Guidelines for Uploading and Downloading JKS and JCEKS Keystores
Oracle provides recommendations for when you upload and download JKS and JCEKS keystores.
-
If there is a change to the content of the original JKS or JCEKS keystore, then upload the keystore again to Oracle Key Vault so that Key Vault has the latest copy of the keystore.
-
Use care if you plan to use the
okvutil uploadandokvutil downloadcommands, which provide an overwrite (-o) option. This option overwrites data in the file. Before you use the-ooption, you should create backups of the keystore files before downloading them. -
Do not try to upload the same physical JKS or JCEKS keystore to more than one virtual wallet on the Oracle Key Vault server. If you want to share a Java keystore with multiple endpoints, then create an endpoint group.
Related Topics
Using a User-Defined Key as the TDE Master Encryption Key
You can import a generated key to be used as the Transparent Data Encryption (TDE) master encryption key in Oracle Key Vault.
-
About Using a User-Defined Key as the TDE Master Encryption Key
Users who have the Key Administrator role can upload a user-defined key to the virtual wallet to which they have write access.
-
Step 1: Upload the User-Defined Key
Use the
okvutil uploadcommand to upload user-defined master encryption keys to Oracle Key Vault. -
Step 2: Activate the User-Defined Key as a TDE Master Encryption Key
After you upload the user-defined key, you are ready to activate the key as a TDE master encryption key.
About Using a User-Defined Key as the TDE Master Encryption Key
Users who have the Key Administrator role can upload a user-defined key to the virtual wallet to which they have write access.
This enables it so that it can be used as the Transparent Data Encryption (TDE) master encryption key. This feature provides key administrators with more control on creation of the master encryption key used to encrypt TDE data encryption keys.
The type parameter of the okvutil upload command includes the option TDE_KEY_BYTES, which enables you to upload user-defined key bytes to Oracle Key Vault to be used as the TDE master encryption key. You must then activate the key as a TDE master encryption key by running the ADMINISTER KEY MANAGEMENT SQL statement on the database.
Be aware that the Extractable attribute setting for the objects that are created in Oracle Key Vault using okvutil upload is inherited from the endpoint. You can download the TDE master encryption key, but if this the key’s objects have the Extractable attribute set to FALSE, then those objects cannot be downloaded.
Related Topics
Step 1: Upload the User-Defined Key
Use the okvutil upload command to upload user-defined master encryption keys to Oracle Key Vault.
The raw bytes data of the user-defined key is stored in a text file and uploaded to Oracle Key Vault. The raw bytes data uploaded to Oracle Key Vault forms part of the TDE Master Encryption Key and the TDE Master Encryption Key Identifier. Additional metadata is added to the raw bytes data to enable the database to identify and activate the data as the TDE Master Encryption Key and the TDE Master Encryption Key. In the text file, the raw bytes data that forms the TDE Master Key is prefixed by TDE Master Encryption Key Identifier. The raw bytes data that forms the TDE Master Key Identifier is prefixed by TDE Master Key Identifier. TDE Master Key Identifier represents the master encryption key in the database. Once the key is activated, you should see the user-defined raw bytes that form the TDE Master Key Identifier as the subset of the KEY_ID column of the V$ENCRYPTION_KEYS view. In Oracle Key Vault, the TDE Master Key and TDE Master Key Identifier values are stored as managed KMIP objects with a symmetric key as a KMIP object type.
Be aware that the Extractable attribute setting for the objects that are created in Oracle Key Vault using okvutil upload is inherited from the endpoint.
To upload the user-defined key:
-
Create a text file containing the raw bytes data of the user-defined key.
Use the following format:
TDE Master Encryption Key Identifier: contiguous_TDE_Master_Encryption_Key_Identifier_bytes_encoded_in_32_hex_characters_(16_bytes_long) TDE Master Encryption Key: contiguous_TDE_Master_Encryption_Key_bytes_encoded_in_64_hex_characters_(32_bytes_long)For example:
TDE Master Encryption Key Identifier: 1F1E1D1C1B1A10191817161514131210 TDE Master Encryption Key: 97cefdb589ef06d56b8d536d3d38b7221a76dfffbf3f28a60d0965b9ae1a785b -
Save the file as
tde_key_bytes.txt. -
Use the
okvutil uploadcommand to uploadtde_key_bytes.txt.The format of the
okvutil uploadcommand is:okvutil upload [--overwrite] --location location --type type [--group group] [-- description description] [--verbose verbosity_level]Example:
$OKV_HOME/bin/okvutil upload -l /home/oracle/tde_key_bytes.txt -t TDE_KEY_BYTES -g "FIN_DATABASE_VIRTUAL_WALLET" -d "This key was created for Financial database use on 1st Mar 2019"In this example:
-
-lspecifies the path to thetde_key_bytes.txtfile. -
-tspecifies the type of the object to upload. To upload a user-defined key, specify the type asTDE_KEY_BYTES. -
-gspecifies the name of an Oracle Key Vault virtual wallet to which the key is added. -
-dspecifies a description for the key.
When
-tisTDE_KEY_BYTES, the description specified for-dis displayed as the tag in theV$ENCRYPTION_KEYSdynamic view. -
-
Specify the required parameters and then press Enter.
-
Enter the Oracle Key Vault endpoint password and press Enter.
The message
Upload succeededis displayed.$OKV_HOME/bin/okvutil upload -l /home/oracle/tde_key_bytes.txt -t TDE_KEY_BYTES -g "FIN_DATABASE_VIRTUAL_WALLET" -d "This key was created for Financial database use on 1st Mar 2019" Enter Oracle Key Vault endpoint password: Upload succeeded -
Carefully delete the
tde_key_bytes.txtfile.
The raw bytes data of the user-defined key is uploaded. The next step is to activate the user-defined key as a TDE master encryption key.
Note:
You cannot create duplicate TDE keys in Oracle Key Vault. The existence of a TDE key is identified by its TDE Master Encryption Key Identifier. When you use the okvutil upload command to upload a TDE key that already exists in Oracle Key Vault, the following behavior applies:
- If the target wallet already contains the key, then key creation is skipped.
- If the target wallet does not contain the key and the endpoint performing the upload has access to the key, then the existing TDE key is added to the wallet.
- If the endpoint performing the upload does not have access to the existing key, then the key is not added to the wallet and the following error is returned:
Error: KMIP Error - Invalid Field. For information about resolving this, see Uploading an Existing TDE Key Failure.
Step 2: Activate the User-Defined Key as a TDE Master Encryption Key
After you upload the user-defined key, you are ready to activate the key as a TDE master encryption key.
The raw bytes data uploaded to Oracle Key Vault for the TDE Master Key Identifier is displayed as the NAME attribute of the KMIP object that is created as the corresponding TDE master encryption key in Oracle Key Vault.
-
Log in to the Oracle Key Vault management console as a user with the Key Administrator role or as a user with access to the virtual wallet.
-
Select the Keys & Wallets tab, then Keys & Secrets in the left navigation bar.
-
In the Object Details page, expand Advanced.
The required Key ID is displayed in the Names area. The Key ID is prefixed with
ORACLE.TDE.HSM.MK.06.For example:
ORACLE.TDE.HSM.MK.061F1E1D1C1B1A10191817161514131210The TDE master encryption key identifiers contain the user defined raw bytes data prefixed by additional metadata.
-
Copy and store the key ID displayed after the prefix
ORACLE.TDE.HSM.MKFor example:
061F1E1D1C1B1A10191817161514131210 -
Connect to the Oracle database as a user who has privileges to run the
ADMINISTER KEY MANAGEMENTSQL statement.For example:
sqlplus C##crypto_admin/ as syskm -
Activate the key as a TDE master encryption key using the
ADMINISTER KEY MANAGEMENTcommand.ADMINISTER KEY MANAGEMENT USE KEY '061F1E1D1C1B1A10191817161514131210' IDENTIFIED BY <OKV-pwd> | EXTERNAL STORE;password;You can query the
TAGcolumn of theV$ENCRYPTION_KEYSview for the identifier of the newly created key.