You can use the following OpenSSL commands to generate the key pair in the required PEM format. If you're using Windows, you'll need to install Git Bash for Windows and run the commands with that tool.
1. Create a directory
2. Generate private key
openssl genrsa -out ~/.oci/oci_api_key.pem 2048
chmod go-rwx ~/.oci/oci_api_key.pem
3. Generate public key:
openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
4. Upload public key to IAM
cat ~/.oci/oci_api_key_public.pem | pbcopy
Your API requests will be signed with your private key and Oracle will use public key to verify the authenticity of your request. The public key must be uploaded to the IAM.