0

I have an unencrypted PEM file I want to secure by requiring a passphrase to unlock (to prevent issues in the case where it is possibly stolen).

How would one go about converting it using a terminal command?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Michael Aquilina
  • 5,352
  • 4
  • 33
  • 38
  • I thought the key could be passphrase protected not the pem itself. Would this http://stackoverflow.com/questions/4294689/how-to-generate-a-key-with-passphrase-from-the-command-line do what you want or did I misunderstood the question ? – tgo Mar 01 '15 at 09:21

1 Answers1

1

I believe this tutorial contains the information you are looking for, more or less, I believe you just need to remove the -passing part:

$ mv test_rsa_key test_rsa_key.old
$ openssl pkcs8 -topk8 -v2 des3 \
    -in test_rsa_key.old \
    -out test_rsa_key -passout 'pass:super secret passphrase'

In any case, openssl is the tool you want to use.

Aaryn Tonita
  • 490
  • 3
  • 7