yaz*_*com 171 certificate openssl ssl-certificate
我正在使用 Windows 并获得了一个 .cer 文件。我如何查看它的详细信息?
Hel*_*ick 282
如果您的系统上安装了OpenSSL,您可以使用OpenSSL x509 工具查看它。
openssl x509 -in cerfile.cer -noout -text
Run Code Online (Sandbox Code Playgroud)
.CER 文件的格式可能要求您指定要显式调用的不同编码格式。
openssl x509 -inform pem -in cerfile.cer -noout -text
Run Code Online (Sandbox Code Playgroud)
或者
openssl x509 -inform der -in cerfile.cer -noout -text
Run Code Online (Sandbox Code Playgroud)
在 Windows 系统上,您可以右键单击 .cer 文件并选择打开。这将让您查看大部分元数据。
在 Windows 上,您可以在运行窗口中使用 certmgr.msc 命令运行 Windows 证书管理器程序。然后您可以导入您的证书并查看详细信息。
lun*_*con 34
如果您使用的是 Windows,则可以使用 console util
certutil -dump <file>
Run Code Online (Sandbox Code Playgroud)
小智 10
对于 MacOS,这里的所有答案都失败了。在 Sierra 和 High Sierra 中唯一有效的是:
openssl x509 -inform der -in cerfile.cer -noout -text
Run Code Online (Sandbox Code Playgroud)
您可以通过Powershell导入和预览它:
Get-ChildItem –Path c:\file.cer | Import-Certificate –CertStoreLocation cert:\LocalMachine\My
Run Code Online (Sandbox Code Playgroud)
然后在 Windows certmgr.msc 中查看或直接加载到 Powershell
SET-LOCATION CERT:\LOCALMACHINE\my
GET-CHILDITEM –RECURSE | FORMAT-LIST –PROPERTY *
Run Code Online (Sandbox Code Playgroud)
或按指纹
$cert = (Get-ChildItem –Path cert:\LocalMachine\My\AE53B1272E43C14545A448FB892F7C07A217A761)
Run Code Online (Sandbox Code Playgroud)
不要忘记导入模块 PKI
或者,您也可以使用Internet Explorer查看、导出、导入和删除证书。
使用 Internet Explorer 查看证书
单击内容选项卡。
在证书下,单击证书。要查看任何证书的详细信息,请选择证书并单击查看。
小智 5
我知道这是一个老问题,但我看到没有人为仅使用 PowerShell 的 Windows 7 提供可行的解决方案。这不需要将其导入证书存储的额外麻烦,也不需要像使用 IE 或 certutil 这样的愚蠢行为。我今天碰巧遇到了同样的问题,这是我想出的解决方案:
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate
$cert.Import("D:\mycert.cer")
$cert.GetEffectiveDateString()
$cert.GetSerialNumber()
$cert | get-member
etc..
Run Code Online (Sandbox Code Playgroud)
x509CEertificate 类不包含的一件事是读取 CRL 的能力。为了做到这一点,你必须使用像 Mono 这样的东西,因为它有一个可以读取它们的类
| 归档时间: |
|
| 查看次数: |
426145 次 |
| 最近记录: |