Managing Oracle AI Database Wallets and Certificates
You can use the orapki command line utility and sqlnet.ora parameters to manage public key infrastructure (PKI) elements.
-
Introduction to Oracle Database Wallets and Certificates
Oracle Database provides several types of public key infrastructure (PKI) elements (wallets and certificates), as well as tools to manage them. -
Managing Oracle Database Wallets and Certificates with the orapki Utility
Theorapkicommand-line utility is installed by default with the Oracle Database server. -
Managing Oracle Database Wallets
Theorapkicommand-line utility enables you to create and manage wallets before you add certificates to them. -
Managing Oracle Database Certificates
After you create a wallet, you can associate certificates with it to validate the identities of entities that are associated with the wallet. -
Examples of Creating Wallets and Certificates Using orapki
Examples oforapkicommands include creating wallets, user certificates, and wallets with self-signed certificates, and exporting certificates. -
orapki Utility Commands Summary
Theorapkicommands perform a variety of wallet, certificate revocation lists (CRL), and certificate management tasks. -
mkstore Utility Commands Summary
Themkstorecommand line utility, available as part other Oracle Database client and server installations, enables you to create wallets and add credential secrets such as user names and passwords.
Introduction to Oracle Database Wallets and Certificates
Oracle Database provides several types of public key infrastructure (PKI) elements (wallets and certificates), as well as tools to manage them.
-
About Oracle Database Wallets
An Oracle Database wallet is a password-protected container that stores authentication and signing credentials, including private keys and certificates that enable database clients to communicate across an Oracle Database network. -
About Oracle Database Certificates
An Oracle Database certificate (public key infrastructure (PKI) digital certificate) is a wallet component that validates the identity of an end entity in a public key or private key exchange that uses the wallet. -
About Certificate Authority (CA)
A certificate authority (CA) is a trusted third party that certifies that other entities—users, databases, administrators, clients, servers—are who they say they are. -
Tools Used to Manage Oracle AI Database Wallets and Certificates
Oracle AI Database provides different tools for managing wallets and certificates, depending on how the wallet will be used. -
General Process of Managing Oracle Database Wallets and Certificates
Except for Transparent Data Encryption (TDE), you can use theorapkiutility to create and manage Oracle Database wallets and certificates. -
Oracle Database Wallet Search Order
The search order that Oracle AI Database uses to find wallets depends on the feature for which the wallet was created, such as Transparent Data Encryption (TDE).
About Oracle Database Wallets
An Oracle Database wallet is a password-protected container that stores authentication and signing credentials, including private keys and certificates that enable database clients to communicate across an Oracle Database network.
The authentication and signing credentials in a wallet are encrypted. Oracle Database clients can read and use wallets when the client connects to the database server. The database server can also read and use wallets when it connects with other services such as directory services. Before a wallet can be used, it must be “open”, that is, made accessible by the database server that must read and use the wallet. Depending on how the wallet is created, the wallet must be either opened manually by a database administrator or it can be opened automatically.
Oracle Database provides the following use cases for wallet use:
-
Outbound wallets, which are used by the database server to connect with outside services, such as Oracle wallets used for Oracle Database connections with Microsoft Active Directory and
UTL_HTTP. These are created and managed with theorapkiutility. -
Secure external password store (SEPS) wallets, which are used for clients only and are created only with the read/write permissions of the current user, so that other users cannot read this wallet.
-
Transport Layer Security (TLS) wallets, for both server and clients. These are used for strong authentication.
-
Transparent Data Encryption (TDE) wallets, which are used for servers and clients, and are called keystores. See Oracle AI Database Advanced Security Guide.
There are four types (or modes) of wallets: standard password-protected wallet (PKCS#12, which have the .p12 file extension), and three types of auto-login wallets.
-
Password-protected wallets: When you create this type of wallet, you must assign it a password. Later on, when you perform different tasks with this wallet, such as modifying it, you must provide the password. This type of wallet must be explicitly opened by a database administrator before it can be used. The password-protected wallet conforms to the PKCS#12 standard with a file name of
ewallet.p12. -
Single sign-on (SSO) auto-login wallets: When you create an auto-login wallet, you must provide a password. An auto-login wallet allows encrypted storage of secrets such as passwords so they are not stored in clear text files. Oracle Database can read the secrets in the wallet without requiring a user to enter a password every time. This type is automatically opened by the database server that accesses it. An auto-login wallet is a read/write wallet that consists of both a PKCS #12 file called
ewallet.p12and a single sign-on (SSO) file calledcwallet.sso. Both files contain the same content except that theewallet.p12is protected with a user password whilecwallet.ssois protected with an obfuscated random password. When you use the Oracle wallet utilities (orapkiandmkstore(deprecated)) to modify auto-login wallets, you must provide the password that was used to create theewallet.p12wallet file. (Any modification can happen only on theewallet.p12file and the changes are internally applied to the correspondingcwallet.ssofile. Thecwallet.ssocannot be modified on its own.)You can use auto-login wallets across different systems. If your environment does not require the extra security provided by a wallet that must be explicitly opened for use, then you can use an auto-login wallet. Auto-login wallets are ideal for unattended scenarios (for example, Oracle Data Guard standby databases).
-
Local single sign-on (LSSO) auto-login wallets: This type is an auto-login wallet that is used only locally to the computer on which it was created. It cannot be opened on any computer other than the one on which it is created. It is a read/write wallet that does not require a user password. It is locked to the host name and user name that were in effect when it was created; it consists only of an SSO file called ` cwallet.sso`.
Local auto-login wallets are used for scenarios where additional security is required (that is, to limit the use of the auto-login for that computer) while supporting an unattended operation. You cannot use local auto-open wallets in Oracle Real Application Clusters (Oracle RAC)-enabled databases, because only shared wallets (in ACFS or ASM) are supported on those systems.
-
Auto-Login only (ALO or ESSO) wallet: This wallet type is a read/write wallet that does not require a user password. It consists an SSO file called
cwallet.sso.
All wallets that you create in this release of Oracle Database are in the PKCS#12 format. You can include the following security objects in a wallet:
-
Certificates, which authenticate and validate user identities and encrypt data on communication channels. You can include the following types of certificates: trusted certificates, root certificates, user certificates, server certificates, private certificates, public certificates, and self-signed certificates.
-
Certificates requests, which are requests submitted by an applicant to a CA to get an SSL certificate.
-
Certificate revocation list (CRL), which is a list of digital certificates that have been revoked by the issuing certificate authority (CA).
-
Secrets (such as passwords).
-
For PKCS#11 wallets, specific PKCS#11 information, such as the path to the PKCS#11 library, tokens, smart cards, token passwords, and the certificate label on the token. The current standard is PKCS#12 and by default, the
orapkiutility creates wallets using this standard. -
For TDE keystores, a master encryption key, which is responsible for encrypting the data it is associated with, such as a table column, tablespace, or database. When you set the key for the wallet, you can specify an encryption algorithm for it, such as AES256. TDE keystores can also store secrets, such as user names and passwords. Note: Be careful about deleting wallets. Doing so can cause problems in the Oracle Database environment if the wallet is in use. If you want to delete a wallet, then back it up beforehand.
Related Topics
-
Managing Oracle Database Wallets and Certificates with the orapki Utility
-
Configuring Centrally Managed Users with Microsoft Active Directory
-
Authenticating and Authorizing IAM Users for Oracle AI Database
-
Authenticating and Authorizing Microsoft Azure Users for Oracle AI Databases
-
Managing the Secure External Password Store for Password Credentials
About Oracle Database Certificates
An Oracle Database certificate (public key infrastructure (PKI) digital certificate) is a wallet component that validates the identity of an end entity in a public key or private key exchange that uses the wallet.
The certificate is an International Telecommunications Union (ITU) x.509 v3 standard data structure that securely binds an identity to a public key. It is created when the public key of an entity is signed by a trusted identity, a certificate authority (CA). The certificate ensures that information in the entity is correct, and that the public key belongs to that entity. A certificate contains the name of the entity, identifying information, expiration date, and a public key. It is also likely to contain a serial number and information about the rights, uses, and privileges associated with the certificate. Finally, it contains information about the CA that issued it.
Oracle Database enables you to configure and work with the following types of certificates:
-
Certificate chain: This is an ordered list of certificates that contain an end-user or subscriber certificate and its certificate authority certificates.
-
Trusted root certificate: This type, which is mandatory, identifies the certificate authority (CA) that issued the server or user certificate. If the server presents its certificate to the client, then the client will not accept that certificate unless it has a trusted root certificate from the CA that issued the server certificate. The reverse is also true: the server only trusts the client certificate if the server has the trusted root certificate that issued the client certificate. The trusted root certificate is the top certificate in a certificate chain, which is an ordered list of certificate components that can comprise the following: server or user certificate, trusted certificate, public or private certificate. Because it is trusted, it enables you to keep customer information private and secure.
-
Private certificate: This type identifies the private key on which the wallet was created. A private certificate is only used by the user or server and is never sent to any other users or servers. A trust certificate validates a signed private or public certificate.
-
Public certificate: This type is identifies the public key on which the wallet is created, and is similar to private certificates. It is a digitally signed document that validates the name and authorization of a sender.
-
Server certificate: This type, which is mandatory, identifies the database server that the wallet will use. It specifies which resources that a given server can have access to. It is sometimes used on devices that several servers share. Server certificates are typically issued to hosts or domains. There will always be a server certificate, even if that certificate is self-signed.
-
User certificate: This type, which is optional, identifies the client that the wallet will use. It specifies which resources that a given user can have access to. It is sometimes used on devices that several users share. When different users log in, their profile and certificate are automatically loaded, granting them access to their required information. User certificates are used in the following cases:
-
For mutual Transport Layer Security (TLS), in which both ends of the communications channel must identify themselves
-
For PKI certificate authentication, in which the user certificate not only identifies the client, but also authenticates the server
-
-
Self-signed certificate: This type is a public key certificate that is not issued by a CA. Configure self-signed certificates when there is no need for anyone to trust it, that is, you are only concerned with encryption. Even with a self-signed certificate, you still need the clients to connect. Therefore, the self-signed certificate is added to the client as a trusted certificate.
Following are some of the PKI elements that are related to certificates:
-
Certificate request: The request has three parts: certification request information, a signature algorithm identifier, and a digital signature on the certification request information. The certification request information consists of the subject’s distinguished name, public key, and an optional set of attributes. The attributes may provide additional information about the subject identity, such as postal address, or a challenge password by which the subject entity may later request certificate revocation. It is not mandatory to create a certificate request for the wallet. You can directly add a trusted certificate to the wallet or even a user certificate if a trusted certificate is already added.
-
Certificate revocation list (CRL): This type is a signed data structure that contains a list of revoked certificates. The authenticity and integrity of the CRL is provided by a digital signature appended to it. Usually, the CRL signer is the same entity that signed the issued certificate. Typically, you create CRLs for user certificates. Because user certificates are held by users, it is not uncommon for them to be lost or stolen. When that happens, the issuing authority revokes them, and then publishes the revocation in the certificate revocation list that the services know not to trust the compromised certificates.
Related Topics
About Certificate Authority (CA)
A certificate authority (CA) is a trusted third party that certifies that other entities-users, databases, administrators, clients, servers-are who they say they are.
When it certifies a user, the CA first seeks verification that the user is not on the certificate revocation list (CRL), then verifies the user’s identity and grants a certificate, signing it with the certificate authority’s private key. The CA has its own certificate and public key which it publishes. Servers and clients use these to verify signatures the certificate authority has made. A CA might be an external company that offers certificate services, or an internal organization such as a corporate management information systems (MIS) department. You must send the certificate request to this CA. The CA will send you a signed user certificate and its associated trusted certificate.
Tools Used to Manage Oracle AI Database Wallets and Certificates
Oracle AI Database provides different tools for managing wallets and certificates, depending on how the wallet will be used.
-
orapkiis a command-line Oracle utility that you can use to create wallets, and then add and manage certificates, certificate requests, and certificate revocation lists (CRLs) in the wallet. -
mkstoreis a command-line Oracle utility that you can use to add secrets and credentials to the wallet and then manage them. It is available in the Oracle AI Database client. Starting in Oracle AI Database release 26ai,mkstoreis deprecated. Oracle recommends that you use theorapkiinstead ofmkstore. -
The
ADMINISTER KEY MANAGEMENTstatement provides a SQL*Plus interface for managing Transparent Data Encryption (TDE) keystores. TDE keystore management also provides data dictionary and dynamic views for finding information about keystores. -
Oracle Key Vault enables you to centrally manage existing keys and security objects within an enterprise. Note: Starting with Oracle AI Database 26ai, the Oracle Wallet Manager (OWM) is desupported.Oracle recommends using the
orapkicommand line tool to replace OWM.
Related Topics
General Process of Managing Oracle Database Wallets and Certificates
Except for Transparent Data Encryption (TDE), you can use the orapki utility to create and manage Oracle Database wallets and certificates.
The general process is as follows:
-
Use the
orapki wallet createcommand to create the wallet.For example, to create the wallet in the
$ORACLE_HOME/admin/db_unique_name/walletdirectory:orapki wallet create -wallet $ORACLE_HOME/admin/db_unique_name/wallet -
Use the
orapki wallet addcommand to generate a certificate request to associate with the wallet.For example, for a DN named
CN=server_dn,C=US, using a key size of 2048 bits:orapki wallet add -wallet $ORACLE_HOME/admin/db_unique_name/wallet -dn 'CN=server_dn,C=US' -keySize 2048 -
After the certificate request is generated, send it to the certificate authority (CA) that you want to use.
You can export the certificate request to a file by using the
orapki wallet exportcommand, and share that file with CA to get a signed certificate.For example, to export a request called
creq.txt:orapki wallet export -wallet $ORACLE_HOME/admin/db_unique_name/wallet -dn 'CN=server_dn,C=US' -request $ORACLE_HOME/admin/db_unique_name/wallet/creq.txt -
The CA generates your signed user certificate and its associated trusted certificate. At this stage, you are ready to start importing certificates into the wallet.
-
Use the
orapki wallet addcommand to import all the trusted certificates into the wallet.If you do not add all the trusted certificates, then the
orapki addcommand will fail.For example, to add a trusted certificate
trusted_cert.txtto the wallet:orapki wallet add -wallet $ORACLE_HOME/admin/db_unique_name/wallet -trusted_cert -cert $ORACLE_HOME/wallet/trusted_cert.txt -
Use the
orapki wallet addcommand to import the user certificate into the wallet.For example, to import a user certificate that is in the
cert.txtfile:orapki wallet add -wallet $ORACLE_HOME/admin/db_unique_name/wallet/ewallet.p12 -user_cert -cert $ORACLE_HOME/wallet/cert.txt
Oracle Database Wallet Search Order
The search order that Oracle AI Database uses to find wallets depends on the feature for which the wallet was created, such as Transparent Data Encryption (TDE).
The Oracle AI Database listener uses the following search path for the wallet, in this order:
-
WALLET_LOCATIONparameter setting in connect string -
WALLET_LOCATIONparameter setting in thesqlnet.orafile -
Wallet in the
$TNS_ADMINenvironment variable setting
The default wallet locations are as follows:
-
Linux:
/etc/ORACLE/WALLETS/user_name -
Windows:
C:\Users\user_name\ORACLE\WALLETS
See the following topics for information about various search orders for wallets:
-
Centrally managed users (CMU) with Microsoft Active Directory:About Using a dsi.ora File
-
Secure external password (SEP) wallets: TBA
-
Transport Layer Security (TLS) server wallets:Oracle Wallet Search Order
-
Transparent Data Encryption keystores: Oracle AI Database Advanced Security Guide
-
Enterprise User Security wallets: Oracle AI Database Enterprise User Security Administrator’s Guide (Note that Enterprise User Security (EUS) is deprecated with Oracle AI Database 26ai.)
Managing Oracle Database Wallets and Certificates with the orapki Utility
The orapki command-line utility is installed by default with the Oracle Database server.
-
About Managing Oracle Database Wallets and Certificates with the orapki Utility
Theorapkicommand-line utility enables you to create and manage wallets and certificates from the command line. -
orapki Utility Syntax
Theorapkiutility syntax provides ways to create and manage wallets and certificates.
About Managing Oracle Database Wallets and Certificates with the orapki Utility
The orapki command-line utility enables you to create and manage wallets and certificates from the command line.
You can use orapki to perform the following tasks:
-
Creating and viewing signed certificates for testing purposes
-
Managing Oracle wallets (except for Transparent Data Encryption keystores):
-
Creating and displaying Oracle wallets
-
Adding and removing certificate requests
-
Adding and removing user certificates
-
Adding and removing trusted certificates
-
Importing and exporting the private key
-
Importing a PKCS12 file
-
Converting a JKS keystore to a PKCS12 file or vice versa
-
Exporting the certificates and certificate chain
-
-
Managing certificate revocation lists (CRLs):
-
Renaming CRLs with a hash value for certificate validation
-
Uploading, listing, viewing, and deleting CRLs in Oracle Internet Directory
-
orapki enables you to automate these tasks by using scripts. Providing a way to incorporate the management of wallets, certificates, and certificate revocation lists (CRLs) into scripts makes it possible to automate many of the routine tasks of maintaining them.
You can use the orapki utility wallet module commands in scripts to automate the wallet creation process. For example, you can create password-protected wallets, auto-login wallets, auto-login-only wallets, or local auto-login wallets. You can create local auto-login wallets that are associated with PKCS#12 wallets that are local to the computer on which they were created and the user who created them. You can view wallets, import wallets, modify wallet passwords, and convert wallets to use the AES256 algorithm.
When you create a new wallet (any type), Oracle creates it as a version 6 wallet. If you modify an existing LSSO version 6 wallet, then orapki converts it to version 7. Oracle has introduced a new auto-login wallet version (7) with Oracle AI Database 26ai. Version 6 of the Oracle local auto-login wallet is deprecated.
Note: The -wallet parameter is mandatory for all wallet module commands.
Related Topics
orapki Utility Syntax
The orapki utility syntax provides ways to create and manage wallets and certificates.
The syntax of the orapki command-line utility is as follows:
orapki module command -parameter value
In this specification, module can be wallet (Oracle wallet), crl (certificate revocation list), cert (PKI digital certificate), or secretstore (secrets and credentials). The available commands depend on the module you are using.
For example, if you are working with a wallet, then you can add a certificate or a key to the wallet with the add command. The following example adds the user certificate located at /private/lhale/cert.txt to the wallet located at $ORACLE_HOME/admin/db_unique_name/wallet/ewallet.p12:
orapki wallet add -wallet $ORACLE_HOME/admin/db_unique_name/wallet/ewallet.p12 -user_cert -cert /private/lhale/cert.txt
Managing Oracle Database Wallets
The orapki command-line utility enables you to create and manage wallets before you add certificates to them.
-
Creating a PKCS#12 Wallet
You can use theorapkiutility to create a PKCS#12 Oracle wallet. -
Importing a PKCS#12 Wallet
You can use theorapkiutility to import a PKCS#12 file into an existing wallet. -
Creating an Auto-Login-Only Wallet
You can use theorapkiutility to create an auto-login only wallet. -
Creating a Local Auto-Login Wallet
Theorapkiutility can create a local auto-login wallet. -
Creating an Auto-Login Wallet That Is Associated with a PKCS#12 Wallet
You can create an auto-login wallet that is associated with a PKCS#12 wallet. -
Viewing a Wallet
You can use theorapkiutility to view a wallet. -
Modifying the Password for a Wallet
You can use theorapkiutility to modify the password of a wallet. -
Converting an Oracle Wallet to Use the AES256 Algorithm
By default, an Oracle wallet that was created with theADMINISTER KEY MANAGEMENTorALTER SYSTEMstatement is encrypted with AES256. -
Copying a Wallet to an ASM Disk Group
You can store an Oracle wallet in an Oracle Automatic Storage Management (Oracle ASM) disk group. -
Deleting a Wallet
You can delete wallets, but be cautious when doing so. Deleting a wallet that is in use can problems with the Oracle Database environment.
Creating a PKCS#12 Wallet
You can use the orapki utility to create a PKCS#12 Oracle wallet.
To create an Oracle PKCS#12 wallet (ewallet.p12), use the orapki wallet create command.
<pre class="copy"><code>orapki wallet create -wallet wallet_file_directory [-pwd password]</code></pre>
In this specification:
-
walletspecifies the location in which to create theewallet.p12wallet file. -
pwdis a new password to be assigned to the wallet. If you create an auto-login wallet later on, then it will require this password. If you do not provide a password using thepwdparameter, then you are prompted to enter and reenter the new password. For better security, enter the password at the prompt instead of entering it at the command line. When you create the password, follow these requirements:-
Use no fewer than 8 characters. The maximum length is unlimited.
-
Use mixed alphanumeric characters.
-
Importing a PKCS#12 Wallet
You can use the orapki utility to import a PKCS#12 file into an existing wallet.
To import an Oracle PKCS#12 wallet (ewallet.p12), use the orapki wallet import_pkcs12 command.
<pre class="copy"><code>orapki wallet import_pkcs12 -wallet wallet_file_directory [[-pwd password] | [-auto_login_only]] [-pkcs12file pkcs12_location] [-pkcs12pwd pkcs12_password]</code></pre>
In this specification:
-
pkcs12filerefers to the Oracle PKCS#12 wallet that to import into thewallet_file_directorylocation. -
pkcs12Pwdis the password of that wallet file.
Creating an Auto-Login-Only Wallet
You can use the orapki utility to create an auto-login only wallet.
To create an auto-login only wallet (cwallet.sso), which does not need a password to open the wallet, use the orapki wallet create command.
<pre class="copy"><code>orapki wallet create -wallet wallet_file_directory -auto_login_only</code></pre>
Note the following:
-
You can modify or delete the auto-login-only wallet without using a password. File system permissions provide the necessary security for such auto-login-only wallets.
-
This command creates a
cwallet.ssofile.
Creating a Local Auto-Login Wallet
The orapki utility can create a local auto-login wallet.
Oracle has introduced a new auto-login wallet version (7) with Oracle AI Database 26ai. Version 6 of the Oracle local auto-login wallet is deprecated.
To create a local auto-login wallet that is local to both the computer on which it is created and the user who created it, use the orapki wallet create command.
<pre class="copy"><code>orapki wallet create -wallet wallet_file_directory -auto_login_local [-pwd wallet_password]</code></pre>
In this specification, pwd is the password that was created when the PKCS#12 wallet was created. If no password is provided, then you are prompted to enter and reenter the new password. For better security, enter the password at the prompt instead of entering it at the command line.
This command does the following:
-
Creates an auto-login wallet (
cwallet.sso) file in the wallet_file_directory. -
Associates the auto-login wallet with a PKCS#12 wallet (
ewallet.p12). If theewallet.p12file does not exist, this command creates it. -
You cannot move local auto-login wallets to another computer. They must be used on the host on which they are created.
-
Even though a local auto-login wallet does not need a password to open, you must supply the password for the associated PKCS#12 wallet in order to modify or delete the wallet. Any update to the PKCS#12 wallet also updates the associated auto-login wallet.
Creating an Auto-Login Wallet That Is Associated with a PKCS#12 Wallet
You can create an auto-login wallet that is associated with a PKCS#12 wallet.
To create an auto-login wallet (cwallet.sso) that is associated with a PKCS#12 wallet (ewallet.p12), use the orapki wallet create command.
orapki wallet create -wallet wallet_file_directory -auto_login [-pwd wallet_password]
In this specification,
-
If the wallet_file_directory already contains a PKCS#12 wallet, then auto-login is enabled for it. You must supply the password for the existing PKCS#12 wallet in order to enable auto-login for it. If the wallet_file_directory does not contain a PKCS#12 wallet, then a new PKCS#12 wallet is created. You must create a password for the new PKCS#12 wallet. Follow these password creation requirements:
-
Use no fewer than 8 characters. The maximum length is unlimited.
-
Use mixed alphanumeric characters.
-
-
pwdis the PKCS#12 wallet password. If no password is provided, then a password prompt appears. For better security, enter the password at the prompt instead of entering it at the command line.
Note that the auto-login wallet does not need a password to open; it automatically uses the password of its associated PKCS#12 wallet. Therefore, you must supply the password for the associated PKCS#12 wallet to modify or delete the auto-login wallet. Any update to the PKCS#12 wallet also updates the associated auto-login wallet.
Viewing a Wallet
You can use the orapki utility to view a wallet.
This command displays the certificate requests, user certificates, trusted certificates, secret store entries, and credentials that are contained in the wallet.
To view an Oracle wallet, use the orapki wallet display command.
orapki wallet display -wallet wallet_file_directory
Output similar to the following appears:
Requested Certificates:
User Certificates:
Trusted Certificates:
Modifying the Password for a Wallet
You can use the orapki utility to modify the password of a wallet.
When you change the password of an auto-login wallet, and if that wallet is version 6, then Oracle Database automatically updates the wallet to version 7.
-
Use the
orapki wallet change_pwdcommand to change the password.orapki wallet change_pwd -wallet wallet_file_directory [-oldpwd wallet_password ] [-newpwd wallet_password]This command changes the current wallet password to the new password. The command prompts you for the old and new passwords if no password is supplied at the command line. Change the password using the following requirements:
-
Use no fewer than 8 characters. The maximum length is unlimited.
-
Use mixed alphanumeric characters.
-
-
If this wallet uses an auto-login only wallet, then regenerate the auto-login only wallet.
orapki wallet create -wallet wallet_file_directory -auto_login_only
Converting an Oracle Wallet to Use the AES256 Algorithm
By default, an Oracle wallet that was created with the ADMINISTER KEY MANAGEMENT or ALTER SYSTEM statement is encrypted with AES256.
If you are using an older wallet that is encrypted with 3DES instead of AES256, then you can use the orapki convert command to convert the wallet to use the AES256 algorithm, which is stronger than 3DES. Oracle wallets that are created with orapki are created with the AES256 algorithm by default.
Be aware that though the AES256 algorithm is stronger than 3DES, there will be some degradation in orapki operations if you use AES256.
To change the wallet algorithm from 3DES to AES256, use the orapki wallet convert command.
orapki wallet convert -wallet wallet_file_directory [-pwd wallet_password] -compat_v12
In this specification:
-
pwdis the wallet password. If no password is provided, then a password prompt appears. For better security, enter the password at the prompt instead of entering it at the command line. -
compat_v12performs the conversion from 3DES to AES256.
You can check if the wallet has been converted from 3DES to AES356 by running the openssl pkcs12 command. For example:
openssl pkcs12 -in sample/ewallet.p12 -info
Enter Import Password: password
Output similar to the following appears. The AES-256-CBC value in the last line confirms that the wallet is encrypted with AES256.
MAC: sha1, Iteration 10000
MAC length: 20, salt length: 8
PKCS7 Encrypted data: PBES2, PBKDF2, AES-256-CBC, Iteration 10000, PRF hmacWithSHA256
Copying a Wallet to an ASM Disk Group
You can store an Oracle wallet in an Oracle Automatic Storage Management (Oracle ASM) disk group.
-
Create the wallet using one of the preceding methods.
-
Start the Automatic Storage Management Command-Line (ASMCMD).
asmcmd -
Copy the wallet files to the ASM disk group. For example:
kscopy /home/oracle/wallets/tls_wallet/cwallet.sso +HMDG/TLS
Deleting a Wallet
You can delete wallets, but be cautious when doing so. Deleting a wallet that is in use can problems with the Oracle Database environment.
-
Check the wallet contents to ensure that it is safe to delete it.
It is important to check a wallet’s contents because some wallets may have additional information that you were not aware of that is being used by the database. Use the following
orapkicommand to check the contents of the wallet:orapki wallet display -wallet wallet_file_directory -
Back up the wallet in case you may need it again.
You should be able to easily recreate the wallet if it is needed again.
-
Delete the wallet.
The following example deletes a password-protected wallet:
orapki wallet delete -wallet $ORACLE_HOME/admin/db_unique_name/wallet Enter password: wallet_passwordTo delete an auto-login wallet, include the
-ssoparameter:orapki wallet delete -wallet $ORACLE_HOME/admin/db_unique_name/wallet -sso Enter password: wallet_password
If you want to delete Transparent Data Encryption keystores, then see Oracle AI Database Advanced Security Guide for information about the dangers of deleting keystores.
Managing Oracle Database Certificates
After you create a wallet, you can associate certificates with it to validate the identities of entities that are associated with the wallet.
-
Certificate Store Location for System Wallets
System wallets are located in the certificate store location. -
Adding a Certificate Request to an Oracle Wallet
You can use theorapkiutility to add certificate requests to Oracle wallets. -
Creating Signed Certificates
Theorapkiutility provides a way to sign user certificate requests by an intermediate or root key. -
Creating a Signed Certificate Using a Self-Signed Root
This certificates creation method involves the use of an Oracle wallet with self signed certificate. -
Adding a Trusted Certificate to an Oracle Wallet
You can use theorapkiutility to add trusted certificates to an Oracle wallet. -
Adding a Root Certificate to an Oracle Wallet
You can use theorapkiutility to add a root certificate to an Oracle wallet. -
Adding Root Certificate Authority That Requires an Intermediate Certificate Using Microsoft Internet Explorer
This procedure explains how to install a new or replacement root certificate authority (CA) by downloading it from Microsoft Explorer versions 5, 6, or 7. -
Adding a User Certificate to an Oracle Wallet
You can use theorapkiutility to add a user certificate to an Oracle wallet. -
Verifying Credentials on the Hardware Device That Uses a PKCS#11 Wallet
You can verify credentials on the hardware device using the PKCS#11 wallet. -
Adding PKCS#11 Information to an Oracle Wallet
A wallet that contains PKCS#11 information can be used like any Oracle wallet. -
Viewing a Certificate
After you create a certificate, you can use theorapkiutility to view it. -
Controlling MD5 and SHA-1 Certificate Use
You can use thesqlnet.orafile to control whether MD5 and SHA-1 signed certificates are accepted. -
Certificate Import and Export Operations
You can useorapkito import and export certificates. -
Management of Certificate Revocation Lists (CRLs) with orapki Utility
You must manage certificate revocation lists (CRLs) with theorapkiutility.
Certificate Store Location for System Wallets
System wallets are located in the certificate store location.
The default certificate store location depends on the platform. For Microsoft Windows, it is in the Microsoft Certificate Store for Microsoft Windows. For Linux, its locations are as follows:
-
/etc/pki/tls/cert.pem -
/etc/ssl/certs/ca-certificates.crt -
/etc/pki/tls/certs/ca-bundle.crt -
/etc/ssl/ca-bundle.pem -
/etc/pki/tls/cacert.pem -
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem -
/etc/ssl/cert.pem
If the certificate authority (CA) is not in any of these locations, then you can create a symlink /etc/pki/tls/cert.pem pointing to the CA certificate file. Only PEM-formatted certificates are supported in all of the system certificate store locations.
Adding a Certificate Request to an Oracle Wallet
You can use the orapki utility to add certificate requests to Oracle wallets.
To add a certificate request to an Oracle wallet, use the orapki wallet add command.
<pre class="copy"><code>orapki wallet add -wallet wallet_file_directory -dn user_dn -keySize 512\|768\|1024\|2048\|4096\|8192\|16384</code></pre>
In this specification:
| Parameter | Description |
|---|---|
wallet |
Specifies the location of the wallet to which you want to add a certificate request. |
dn |
Specifies the distinguished name of the certificate to add. |
keySize |
This parameter only applies to certificates with the asym_alg parameter set to RSA. Specifies the key size in bits for the certificate. The size that you enter indicates the strength of security for the certificate. Values are as follows: 512: Included for backward compatibility and is supported in non-FIPS mode768: Supported in non-FIPS mode1024: Current default for non-FIPS certificate keys and is supported in non-FIPS mode2048: Current default for FIPS certificate keys4096: As needed per your site’s requirements8192: As needed per your site’s requirements16384: As needed per your site’s requirements |
To sign the request, export it with the orapki wallet export command.
Related Topics
Creating Signed Certificates
The orapki utility provides a way to sign user certificate requests by an intermediate or root key.
In most cases, this command is used to create a signed certificate for testing purposes, but it can be used for other reasons as well. It creates a signed certificate from the certificate request. A self-signed certificate is not issued or signed by a Certificate Authority (CA).
To create a signed certificate, use the orapki cert create command.
orapki cert create [-wallet wallet_file_directory] -request certificate_request_location -cert certificate_file -validity number_of_days [-pwd wallet_password] [-cert_validation_mode strict|non-strict]
In this specification:
-
walletspecifies the wallet containing the user certificate and private key that will be used to sign the certificate request. -
validityspecifies the number of days, starting from the current date, that this certificate will be valid. Specifying a certificate and certificate request is mandatory for this command. -
pwdis the wallet password. If you omit this parameter, then you are prompted for the password. For better security, enter the password at this prompt. -
cert_validation_modespecifies if strict certificate validation, conforming to the RFC#5280 standard is (strict) or is not (non-strict) being used.
Creating a Signed Certificate Using a Self-Signed Root
This certificates creation method involves the use of an Oracle wallet with self signed certificate.
Using a certificate signed by a public Certificate Authority (CA) simplifies TLS connections because the root trust certificate for the database server is most likely already available in the default trust store on clients.
-
Create a wallet and add a self-signed root certificate to this wallet.
-
Create the wallet as follows:
Create the wallet in its own directory (for example,
wallet1) under the wallet directory structureorapki wallet create -wallet wallet_file_directory/wallet1 -pwd wallet_password -auto_loginThe default algorithm is AES256.
-
Add a self-signed certificate to this wallet.
For example:
orapki wallet add -wallet wallet_file_directory/wallet1 -dn 'CN=sales.us.example.com, O=Oracle, L=Reading, ST=Texas, C=US' -self_signed -validity 3650 -keysize 2048 -sign_alg sha256 -pwd wallet_password
-
-
Create a second wallet in its own directory (for example,
wallet2) for the certificate.orapki wallet create -wallet wallet_file_directory/wallet2 -pwd wallet_password -auto_login -
Add a certificate request to this second wallet and export it into a file.
orapki wallet add -wallet wallet_file_directory/wallet2 -dn 'CN=server_test,C=US' -keysize 2048 -pwd wallet_password orapki wallet export -wallet wallet_file_directory/wallet2 -dn 'CN=server_test,C=US' -request creq.txt -pwd wallet_password -
Use the first wallet with a self-signed root key to sign the certificate request
creq.txt.The option
-sign_alg sha256setting to specifies the SHA-2 algorithm. The fileusercert.txtfile will contain the SHA-2 certificate.orapki cert create -wallet wallet_file_directory/wallet1 -request wallet_file_directory/wallet2/creq.txt -cert wallet_file_directory/wallet2/usercert.txt -sign_alg sha256 -validity 3650 -
Verify that the user certificate has been created with SHA-2 algorithm.
openssl x509 -in wallet_file_directory/wallet2/usercert.txt -textOutput similar to the following appears:
Certificate: Data: Version: 1 (0x0) Serial Number: 0 (0x0) Signature Algorithm: sha256WithRSAEncryption Issuer: C=US, ST=Texas, L=Reading, O=Oracle, sales.us.example.com Validity Not Before: Aug 5 06:50:44 2023 GMT Not After : Aug 2 06:50:44 2027 GMT Subject: C=US, CN=server_test Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): 00:b0:36:ba:33:86:9f:f2:03:c0:13:b5:a2:99:09: ... oU6jgrYfZkxcMMZMhnWKCpNBdA== -----END CERTIFICATE----- -
Export the self-signed certificate from the first wallet and import it as a trusted certificate into the second wallet.
To add the signed certificate into the original (second wallet), first you must import the root trust certificate and any intermediate trust certificates in hierarchical order before you can add the newly signed user certificate. This example uses the root private key to sign the user certificate, so you just need to export the self-signed root certificate from the first wallet and then import it as a trusted certificate into the second wallet.
orapki wallet export -wallet wallet_file_directory/wallet1 -dn 'CN=sales.us.example.com, O=Oracle, L=Reading, ST=Texas, C=US' -cert self_cert.crt orapki wallet add -wallet wallet_file_directory/wallet2 -trusted_cert -cert /wallet_file_directory/wallet1/self_cert.crt -pwd wallet_password -
Import the certificate file
usercert.txtinto the second wallet.orapki wallet add -wallet wallet_file_directory/wallet2 -user_cert -cert wallet_file_directory/wallet2/usercert.txt -sign_alg sha256 -pwd wallet_password -
In the domain for the wallet and certificate, display the wallet to confirm.
[sales]wallet_file_directory/wallet2> orapki wallet display -wallet .Output similar to the following should appear:
Requested Certificates: User Certificates: Subject: CN=server_test,C=US Trusted Certificates: Subject: O=Oracle\, Inc.,C=US, Inc.,C=US Subject: CN=GTE CyberTrust Global Root, Inc.,O=GTE Corporation,C=US
Adding a Trusted Certificate to an Oracle Wallet
You can use the orapki utility to add trusted certificates to an Oracle wallet.
This command adds a trusted certificate to the specified location (-cert certificate_file_directory), to a wallet. You must add all trusted certificates in the certificate chain of a user certificate before adding a user certificate, or the command to add the user certificate will fail.
To add a trusted certificate to an Oracle wallet, use the orapki wallet add command.
orapki wallet add -wallet wallet_file_directory -trusted_cert -cert certificate_file [-pwd wallet_password]
If you omit the -pwd parameter, then you are prompted to enter the wallet password. For better security, enter the password at this prompt.
Adding a Root Certificate to an Oracle Wallet
You can use the orapki utility to add a root certificate to an Oracle wallet.
This command creates a new self-signed (root) certificate and adds it to the wallet.
To add a root certificate to an Oracle wallet, use the orapki wallet add command.
orapki wallet add -wallet wallet_file_directory -dn certificate_dn -keySize 512\|768\|1024\|2048\|4096\|8192\|16384 -self_signed -validity number_of_days
[-pwd wallet_password] [-cert_validation_mode strict|non-strict]
In this specification:
-
validityspecifies the number of days, starting from the current date, that this certificate will be valid. This parameter is mandatory. -
keySizespecifies the key size in bits of the requested certificate. The size that you enter indicates the strength of security for the certificate. Values are as follows:-
512: Included for backward compatibility and is supported in non-FIPS mode -
768: Supported in non-FIPS mode -
1024: Current default for non-FIPS certificate keys and is supported in non-FIPS mode -
2048: Current default for FIPS certificate keys -
4096: As needed per your site’s requirements -
8192: As needed per your site’s requirements -
16384: As needed per your site’s requirements
-
-
pwdis the wallet password. If you omit this parameter, then you are prompted for the password. For better security, enter the password at this prompt. -
cert_validation_modespecifies if strict certificate validation, conforming to the RFC#5280 standard is (strict) or is not (non-strict) being used.
Adding Root Certificate Authority That Requires an Intermediate Certificate Using Microsoft Internet Explorer
This procedure explains how to install a new or replacement root certificate authority (CA) by downloading it from Microsoft Explorer versions 5, 6, or 7.
-
In Internet Explorer, select Tools, then Internet Options, then Content, then Certificates.
-
Selct the Trusted Root Certification Authorities tab.
-
Select Issued to: ….
-
Click Export.
-
In the wizard that opens, select Next, then Select Base-64 encoded X.509 (.CER).
-
Enter a file name and select Finish.
Adding a User Certificate to an Oracle Wallet
You can use the orapki utility to add a user certificate to an Oracle wallet.
Use the orapki wallet add command to add the user certificate to the wallet.
orapki wallet add -wallet wallet_file_directory -user_cert -cert certificate_file_directory [-pwd wallet_password]
If you omit the -pwd parameter, then you are prompted to enter the wallet password. For better security, enter the password at this prompt.
Verifying Credentials on the Hardware Device That Uses a PKCS#11 Wallet
You can verify credentials on the hardware device using the PKCS#11 wallet.
To verify the credential details, use the orapki wallet p11_verify command.
orapki wallet p11_verify -wallet wallet_file_directory [-pwd wallet_password]
pwd is the wallet password. If no password is provided, then a password prompt appears. For better security, enter the password at the prompt instead of entering it at the command line
Adding PKCS#11 Information to an Oracle Wallet
A wallet that contains PKCS#11 information can be used like any Oracle wallet.
The private keys for this type of wallet are stored on a hardware device. Hardware devices maintain the private key and perform cryptographic operations using the private key. Therefore, the private key is never needed outside of the hardware device boundary.
To add PKCS#11 information to a wallet, use the orapki wallet p11_add command.
orapki wallet p11_add -wallet wallet_file_directory -p11_lib pkcs11Lib
[-p11_tokenlabel tokenLabel] [-p11_tokenpw tokenPassphrase]
[-p11_certlabel certLabel] [-pwd wallet_password]
In this specification:
-
p11_libspecifies the path to the PKCS#11 library. This includes the library file name. -
p11_tokenlabelspecifies the token or smart card used on the device. Use this when there are multiple tokens on the device. Token labels are set using vendor tools. -
p11_tokenpwspecifies the password that is used to access the token. Token passwords are set using vendor tools. -
p11_certlabelis used to specify a certificate label on the token. Use this when a token contains multiple certificates. Certificate labels are set using vendor tools. -
pwdis the wallet password. If no password is provided, then a password prompt appears. For better security, enter the password at the prompt instead of entering it at the command line.
Viewing a Certificate
After you create a certificate, you can use the orapki utility to view it.
To view a certificate, use the orapki cert display command.
orapki cert display -cert certificate_file_directory [-complete]
In this specification:
-
summarydisplays the certificate and its expiration date. -
completedisplays additional certificate information, including the serial number and public key.
Controlling MD5 and SHA-1 Certificate Use
You can use the sqlnet.ora file to control whether MD5 and SHA-1 signed certificates are accepted.
To control whether the MD5 and SHA-1 signed certificates are accepted, you can edit the sqlnet.ora file to enable or disable their use.
Note: MD5 is deprecated in this release.
-
Log in to the server where the Oracle database resides.
-
Edit the
sqlnet.orafile.By default, the
sqlnet.orafile is located in the$ORACLE_HOME/dbsdirectory or in the location set by theTNS_ADMINenvironment variable. -
Set the following parameters:
-
ACCEPT_MD5_CERTScontrols the use of MD5 certificates. The default isFALSE. This parameter replaces theORACLE_SSL_ALLOW_MD5_CERT_SIGNATURESenvironment variable. -
ACCEPT_SHA1_CERTScontrols the use of SHA-1 certificates. The default isTRUE.
-
Certificate Import and Export Operations
You can use orapki to import and export certificates.
-
Importing a User-Supplied or Trusted Certificate into an Oracle Wallet
You can add a user-supplied or trusted certificate to an Oracle wallet. -
Exporting Certificates and Certificate Requests from an Oracle Wallet
You can use theorapkiutility to export certificates and certificate requests from an Oracle wallet.
Importing a User-Supplied or Trusted Certificate into an Oracle Wallet
You can add a user-supplied or trusted certificate to an Oracle wallet.
Use the orapki wallet add -wallet command as follows:
-
To add a trusted certificate to an Oracle wallet, use the
-trusted_certparameter.orapki wallet add -wallet wallet_file_directory [-pwd wallet_password] -trusted_cert -cert root_and/or_intermediate_certificate_file -
To add a user-created certificate to an Oracle wallet, use the
-user_certparameter.orapki wallet add -wallet wallet_file_directory [-pwd wallet_password] -user_cert -cert user_certificate_file
In this specification, pwd is the wallet password. If no password is provided, then a password prompt appears. For better security, enter the password at the prompt instead of entering it at the command line.
Exporting Certificates and Certificate Requests from an Oracle Wallet
You can use the orapki utility to export certificates and certificate requests from an Oracle wallet.
Depending on the type of certificate that you want to export from a wallet, use the orapki wallet export command.
-
To export a certificate with the subject’s distinguished name (
-dn) to a file that is specified by the-certparameter:orapki wallet export -wallet wallet_file_directory -dn certificate_dn -cert certificate_filename
dn specifies the distinguished name of the certificate. In the case of a multi-valued DN, the order in which the individual DN values are stored in the wallet is uncertain. To find the correct DN that you want, run orapki wallet display.
-
To export a certificate with an alias:
orapki wallet export -wallet wallet_file_directory -alias alias_name -cert certificate_filename -
To export a certificate request with the subject’s distinguished name (
-dn) to a file that is specified by the-requestparameter:orapki wallet export -wallet wallet_file_directory -dn certificate_request_dn -request certificate_request_filename -
To export private keys, use the following syntax:
orapki export_private_key -wallet wallet_file_directory -pvtkeyfile pvt_key_file -alias pvt_key_alias -pvtkeypwd pvt_key_password
Related Topics
Management of Certificate Revocation Lists (CRLs) with orapki Utility
You must manage certificate revocation lists (CRLs) with the orapki utility.
This utility creates a hashed value of the CRL issuer’s name to identify the CRLs location in your system. If you do not use orapki, your Oracle server cannot locate CRLs to validate PKI digital certificates.
Related Topics