How to extract private key from PFX file - Rocketeers app

  [ Rocketeers ](/)   

[Login](https://rocketeersapp.com/login) 

 On this page

 Knowledge
---------

How to extract private key from PFX file
========================================

### [\#Security](https://rocketeersapp.com/knowledge/security)

Sometimes you receive a PFX file, which is a file that bundles both certificate and private key of a SSL certificate. Here's how to extract the private key.

 Published by [Mark van Eijk](https://rocketeersapp.com/author/mark-van-eijk) on August 10, 2022 · 1 minute read

For this we need the `openssl` command line tool. Using the following command you can extract the private key from a PFX file:

 ```
openssl pkcs12 -in pfx-file.pfx -nocerts -out private-key-file.pem -nodes

```

### Subscribe to our newsletter

Do you want to receive regular updates with fresh and exclusive content to learn more about web development, hosting, security and performance? Subscribe now!

  Fill in your email address to receive updates  Subscribe 

#### More in [\#Security](https://rocketeersapp.com/knowledge/security)

- [How to extract the certificate from a PFX file](https://rocketeersapp.com/knowledge/extract-certificate-from-pfx-file)
- [How to optimize web application security](https://rocketeersapp.com/knowledge/optimize-web-application-security)
- [How to get A+ grade SSL using Cloudflare](https://rocketeersapp.com/knowledge/a-plus-grade-ssl-using-cloudflare)
- [How to setup OpenClaw securely on your own VPS](https://rocketeersapp.com/knowledge/setup-openclaw-vps-securely)
- [How to generate a CSR with OpenSSL](https://rocketeersapp.com/knowledge/generate-csr-with-openssl)
- [What is an SSH key](https://rocketeersapp.com/knowledge/what-is-an-ssh-key)

 [View all 15 articles →](https://rocketeersapp.com/knowledge/security)
