Showing posts with label pfx. Show all posts
Showing posts with label pfx. Show all posts

October 07, 2021

Convert PEM to PFX/PKCS12(.p12) using OpenSSL

 Hi folks,

To keep it simple with a single command to convert the .PEM format file to .p12/.pfx we can use the below information.

$ openssl pkcs12 -export -in domain.pem -out domain.p12



It will ask you to enter the export password (twice for confirmation).

It's up to you to choose to enter the password or keep it empty (just press enter) based on the use case what you have.


Hope this helps you to convert the certificate format and use in your application or server.


Request to send your comments and feedback to psrdotcom@gmail.com

October 31, 2020

Generate or Create ECDSA - Elliptic Curve Digital Signature Algorithm Keys using OpenSSL in Windows

 Hi folks,

Today we will see how we can create ECDSA (Elliptic Curve Digital Signature Algorithm) Keys


Pre-requisites

OpenSSL

Add openssl bin directory to the environment PATH variable 


Generate Keys

Open Powershell and execute the following commands

1. Get the ECC curves list

openssl ecparam -list_curves
2. Generate a private key using your chosen curve
openssl ecparam -name prime256v1 -genkey -noout -out private-key.pem
3. Generate public key from the private key
openssl ec -in private-key.pem -pubout -out public-key.pem

4. Create a self-signed certificate with 1 year validity
openssl req -new -x509 -config "<opensslDirPath>/share/openssl.cnf" -key private-key.pem -out cert.pem -days 360

5. Convert pem to pfx
get-content private-key.pem, cert.pem | out-file cert-with-private-key
openssl pkcs12 -export -inkey private-key.pem -in cert-with-private-key -out cert.pfx

 Note: Enter the password when prompted (Optional)

Now, you can install the PFX file and check the certificate properties and make use of it.

Send your valuable feedback and comments to psrdotcom@gmail.com


Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com