这里的所有标识符都用于私钥。私钥不知道证书的位置,因为架构是证书对象/证书存储知道给定证书的私钥在哪里。
要查看证书存储中的证书与系统上的密钥之间的映射,您可以使用certutil -store,例如:
C:\>certutil -store my
my
================ Certificate 0 ================
...
================ Certificate 7 ================
Serial Number: 3451b93c10f9279348a949f729d1ff10
Issuer: CN=localhost
NotBefore: 1/26/2015 2:19 PM
NotAfter: 1/25/2020 4:00 PM
Subject: CN=localhost
Signature matches Public Key
Root Certificate: Subject matches Issuer
Template:
Cert Hash(sha1): 15 e3 4c d3 2d a7 54 99 a9 17 8f 17 26 25 63 25 8f 3a 94 28
Key Container = IIS Express Development Certificate Container
Unique container name: fad662b360941f26a1193357aab3c12d_1fcb2e07-cec4-4ba1-9c78-58a431e1aefd
Provider = Microsoft RSA SChannel Cryptographic Provider
Encryption test passed
CertUtil: -store command completed successfully.
在此输出中要匹配的东西是 Key Container 与事件中的 KeyContainerName 相同,并且此输出中的 Provider 在事件中是 ProviderName。
你也可以dump用户存储(默认是机器):
C:\>certutil -user -store -silent my
my
================ Certificate 0 ================
Serial Number: 0123456789abcdef
Issuer: E=issueremail@example.org, CN=cn.issuer.example.org, OU=ExampleOU, O=ExampleO, L=Locality, S=State, C=Country
NotBefore: 11/12/2013 6:15 AM
NotAfter: 12/13/2014 7:16 AM
Subject: E=subjectemail@example.org, CN=cn.subject.example.org, OU=ExampleOU, O=ExampleO, L=Locality, S=State, C=Country
Non-root Certificate
Template:
Cert Hash(sha1): ff 3d 35 54 54 fd ff ea 52 cd 71 6f e7 14 24 75 3f f7 fe cf
Key Container = {F76693EF-BDC3-4AEC-855A-3A2F65EB9C14}
Unique container name: 0148994a057f4e05acb6407550cdde40_1fcb2e07-cec4-4ba1-9c78-58a431e1aefd
Provider = Microsoft Enhanced RSA and AES Cryptographic Provider
Private key is NOT exportable
Encryption test passed
...
================ Certificate 51 ================
Serial Number: 0123456789abcdef
Issuer: E=issueremail@example.org, CN=cn.issuer.example.org, OU=ExampleOU, O=ExampleO, L=Locality, S=State, C=Country
NotBefore: 11/12/2013 6:15 AM
NotAfter: 12/13/2014 7:16 AM
Subject: E=subjectemail@example.org, L=Locality, S=State, C=Country
Non-root Certificate
Template:
Cert Hash(sha1): 2a 81 f8 d1 c7 40 13 2f 15 5a 5e 30 41 1a 2b 13 71 93 db 9e
Key Container = {2572D484-D352-4B32-BB00-236B755B7F81}
Unique container name: b11d717c1718a3bc6ad1769f2226998e_1fcb2e07-cec4-4ba1-9c78-58a431e1aefd
Provider = Microsoft Enhanced RSA and AES Cryptographic Provider
Private key is NOT exportable
Encryption test passed
除了-user 开关之外,我还指定了-silent,因为我有一些智能卡支持的证书,我不想处理提示输入卡和 PIN 的问题。