openssl x509 -inform der -in cerfile.cer -noout -text
On Windows systems you can right click the .cer file and select Open. That will then let you view most of the meta data.
On Windows you run Windows certificate manager program using certmgr.msc command in the run window. Then you can import your certificates and view details.
I know this is an old question, but I saw no one provided a workable solution for windows 7 using only powershell. That didn't require the extra hassle of importing it into the certificate store,other tom foolery like using IE or certutil. I happened to have the same issue today, and this is the solution I came up with:
One thing the x509CErtificate class does not contain is the ability to read CRLs. In order to do that you have to use something like Mono since it has a class that will read them
I found openssl quite limiting (cannot parse content of chain/bundle, output is quite noisy for my needs, ...), I have created certinfo project on github, which can parse chain/bundle, accepts multiple files as argument and can get cert info from host as well if the argument is in the form of host:port.
OpenSSL will allow you to look at it if it is installed on your system, using the OpenSSL x509 tool.
The format of the .CER file might require that you specify a different encoding format to be explicitly called out.
or
On Windows systems you can right click the .cer file and select Open. That will then let you view most of the meta data.
On Windows you run Windows certificate manager program using certmgr.msc command in the run window. Then you can import your certificates and view details.
If you're using Windows, you can use console util
All answers here fail for MacOS. The only thing that works in Sierra and High Sierra is:
You can import and preview it by Powershell:
then view it in Windows certmgr.msc or load directly to Powershell
or by Thumbprint
Don't forget to IMPORT-MODULE PKI
Or you can also view, export, import, and delete certificates by using Internet Explorer.
To view certificates with Internet Explorer
Click the Content tab.
Under Certificates, click Certificates. To view details of any certificate, select the certificate and click View.
I know this is an old question, but I saw no one provided a workable solution for windows 7 using only powershell. That didn't require the extra hassle of importing it into the certificate store,other tom foolery like using IE or certutil. I happened to have the same issue today, and this is the solution I came up with:
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate
$cert.Import("D:\mycert.cer")
$cert.GetEffectiveDateString() $cert.GetSerialNumber() $cert | get-member etc..
One thing the x509CErtificate class does not contain is the ability to read CRLs. In order to do that you have to use something like Mono since it has a class that will read them
I found openssl quite limiting (cannot parse content of chain/bundle, output is quite noisy for my needs, ...), I have created certinfo project on github, which can parse chain/bundle, accepts multiple files as argument and can get cert info from host as well if the argument is in the form of
host:port
.