To generate private key, execute below command:
Step 1. Generate the private key:
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048Step 2: Generate the Public Key from the Private Key:
openssl rsa -pubout -in private_key.pem -out public_key.pemStep 3: Convert the Private Key to Base64:
openssl base64 -A -in private_key.pem -out private_key_base64.txtStep 4: Convert the Public Key to Base64:
openssl base64 -A -in public_key.pem -out public_key_base64.txtThe -A flag in the openssl base64 command ensures that the Base64 output is in a single line.

