How do I get the public key from a PFX certificate using Powershell?

Question:

I am trying to extract the public key from a certificate using Powershell. However, whenever I use the Powershell command Get-PfxCertificate it only outputs the Thumbprint of the certificate and not the public key. How can I get it to output the public key?

Answer:

To retrieve the public key from a PFX certificate using Powershell, use the following command:

To convert the public key to a hex string without hyphens you can use this command:

Source:

How do I get the public key from a PFX certificate using Powershell? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply