OTD: How to generate the private key from an OTD CSR

Context: The Certificate request has been created from OTD and the certificate must now be moved to another server. Question is how to retrieve the private key stored into the key4.db file.

To retrieve the private key, first generate the pkcs12 file, which contains both the private key and the certificate into an encrypted format.

${ORACLE_HOME}/bin/pk12util -o <name>.p12 -d /u01/app/otd/instances/<instance>/net-<config>/config -n <certifcate nickname>

Then extract the private key only from the p12 file. Specify the password just given when generating the p12 file.

openssl pkcs12 -in <name>.p12 -out <name>.key -nocerts -nodes