Windows中通过命令行查询所有SSL证书
一、命令1,显示分类简称(certutil用)及全称(certmgr图形界面的TAB)
C:\certutil -enumstore
(CurrentUser: -user)
LocalMachine
(CurrentService: -service)
(Services: -service -service)
(Users: -user -user)
(CurrentUserGroupPolicy: -user -grouppolicy)
(LocalMachineGroupPolicy: -grouppolicy)
(LocalMachineEnterprise: -enterprise)
My "Personal"
Root "Trusted Root Certification Authorities"
Trust "Enterprise Trust"
CA "Intermediate Certification Authorities"
TrustedPublisher "Trusted Publishers"
Disallowed "Untrusted Certificates"
AuthRoot "Third-Party Root Certification Authorities"
TrustedPeople "Trusted People"
ClientAuthIssuer "Client Authentication Issuers"
FlightRoot "Preview Build Roots"
TestSignRoot "Test Roots"
AAD Token Issuer
addressbook "Other People"
eSIM Certification Authorities
Homegroup Machine Certificates
Local NonRemovable Certificates
OpenVPN Certificate Store
REQUEST "Certificate Enrollment Requests"
SmartCardRoot "Smart Card Trusted Roots"
TrustedAppRoot "Trusted Packaged App Installation Authorities"
TrustedDevices "Trusted Devices"
Windows Live ID Token Issuer
WindowsServerUpdateServices
CertUtil: -enumstore command completed successfully.
二、命令2,显示全部SSL证书
C:\certutil -store
CA "Intermediate Certification Authorities"
================ Certificate 0 ================
Serial Number: 1000000012
Issuer: CN=CFCA CS SM2 CA, O=China Financial Certification Authority, C=CN
NotBefore: 2015/9/27 9:55
NotAfter: 2035/7/4 9:55
Subject: CN=CFCA ACS SM2 OCA31, O=China Financial Certification Authority, C=CN
Non-root Certificate
Cert Hash(sha1): ffecc2b7d68474b9f82d9143717b20dfb8943453
No key provider information
Cannot find the certificate and private key for decryption.
================ Certificate 1 ================
Serial Number: 06376c00aa00648a11cfb8d4aa5c35f4
Issuer: CN=Root Agency
NotBefore: 1996/5/29 6:02
NotAfter: 2040/1/1 7:59
Subject: CN=Root Agency
Signature matches Public Key
Root Certificate: Subject matches Issuer
Cert Hash(sha1): fee449ee0e3965a5246f000e87fde2a065fd89d4
No key provider information
Cannot find the certificate and private key for decryption.
================ Certificate 2 ================
Serial Number: 35fa6b4521c6e75270a78aee64415e7c
Issuer: CN=CFCA ACS CA, O=China Financial Certification Authority, C=CN
NotBefore: 2015/9/27 11:14
NotAfter: 2035/9/22 11:14
...
三、命令3,UKey插入前后的区别,找出UKey自动注入到Windows证书库的证书
certutil -store Root > 1.txt
certutil -store Root > 2.txt
diff 1.txt 2.txt
在Windows系统中,要列出所有证书,可以使用certutil命令行工具。以下是一些常用的certutil命令来查看和管理证书:
查看证书存储:使用-store参数可以查看特定的证书存储。例如,要查看个人证书存储,可以使用以下命令:
certutil -store My
这将列出当前用户的个人证书存储中的所有证书。
枚举证书存储:使用-enumstore参数可以枚举系统中的所有证书存储。例如:
certutil -enumstore My
这将列出当前用户的个人证书存储中的所有证书。
查看证书详细信息:如果你想要查看某个特定证书的详细信息,可以使用-store参数后跟证书的序列号或哈希值。例如:
certutil -store My 01:23:45:67:89:AB:CD:EF
这将显示与给定序列号匹配的证书的详细信息。
导出证书:使用-exportPFX参数可以导出证书及其私钥到一个PFX文件。例如:
certutil -exportPFX My 01:23:45:67:89:AB:CD:EF mycert.pfx
这将把个人存储中与给定序列号匹配的证书及其私钥导出到mycert.pfx文件中。
导入证书:使用-importPFX参数可以导入一个PFX文件到证书存储。例如:
certutil -importPFX My mycert.pfx
这将把mycert.pfx文件中的证书和私钥导入到个人证书存储中。
删除证书:使用-delstore参数可以删除存储中的证书。例如:
certutil -delstore My 01:23:45:67:89:AB:CD:EF
这将删除个人存储中与给定序列号匹配的证书。
查看所有证书颁发机构(CA):使用-cainfo参数可以查看有关证书颁发机构的信息。例如:
certutil -CAInfo
这将显示所有配置的证书颁发机构的信息。
这些是一些基本的certutil命令,用于管理和查看Windows系统中的证书。更多详细信息和高级用法,可以参考微软的官方文档。
搜索更多相关主题的帖子:
windows SSL 证书 certmgr certutil CMD ukey