create password on private key

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

create password on private key

Martijn Moret
Hi,

I created a certificate request with a private key with no password.
openssl req -new -nodes -keyout private.key -out public.csr

No, my application requires a private key password to import the key. is
there any way to add a password on the private key??

The certificate and private key works fine in apache.

Regards & TIA
Martijn




______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: create password on private key

Jorey Bump
Martijn Moret wrote:

> I created a certificate request with a private key with no password.
> openssl req -new -nodes -keyout private.key -out public.csr
>
> No, my application requires a private key password to import the key. is
> there any way to add a password on the private key??
>
> The certificate and private key works fine in apache.

Something like this will create a passphrase protected private key from
your passphraseless one:

   openssl rsa -in private.key -des3 -out newprivate.key

man rsa for other options, if you need it in a different format.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: create password on private key

Martijn Moret
> Martijn Moret wrote:
>
>> I created a certificate request with a private key with no password.
>> openssl req -new -nodes -keyout private.key -out public.csr
>>
>> No, my application requires a private key password to import the key. is
>> there any way to add a password on the private key??
>>
>> The certificate and private key works fine in apache.
>
> Something like this will create a passphrase protected private key from
> your passphraseless one:
>
>    openssl rsa -in private.key -des3 -out newprivate.key
>
> man rsa for other options, if you need it in a different format.

Thanks!

Works great.
I also found out that creating a pkcs12 file works!

openssl pkcs12 -export -out exported.pk12 -inkey private.key -in cert.crt

Martijn
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [hidden email]
> Automated List Manager                           [hidden email]
>


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]