0

on cli if you type this

openssl rsa -in cert_export_client.key -out cert_export_client.key

it will prompt to enter your passphrase. Is is possible to automate with python?

Ruli
  • 2,592
  • 12
  • 30
  • 40
kch
  • 3
  • 1

1 Answers1

0

You can use the the os module:

from os import system
system("openssl rsa -in cert_export_client.key -out cert_export_client.key")

The system function executes the given command in a subshell.

mehtaarn000
  • 176
  • 1
  • 3
  • 11
  • but then is prompt the to Enter pass phrase. How i can define the password as variable and automate together? the output is : ``` "Enter pass phrase for cert_export_client.key:" ``` – kch Nov 29 '20 at 09:34
  • I'm not familiar with openssl, but I can [link](https://stackoverflow.com/questions/4294689/how-to-generate-an-openssl-key-using-a-passphrase-from-the-command-line) a similar question that has been answered. – mehtaarn000 Nov 30 '20 at 07:19