“查找私钥”工具 (FindPrivateKey.exe)

可以使用此命令行工具从证书存储区中检索私钥。 例如,可以使用 FindPrivateKey.exe 来查找与证书存储中特定 X.509 证书关联的私钥文件的位置和名称。

重要

FindPrivateKey 工具附带作为一个 WCF 示例。 有关在何处找到此示例以及如何构建此示例的详细信息,请参阅 FindPrivateKey

语法

FindPrivateKey<storeName> <storeLocation> [{ {-n <subjectName>} | {-t <thumbprint>} } [-f | -d | -a]]

备注

下表介绍了可用于“查找私钥”工具 (FindPrivateKey.exe) 的自变量和选项。

参数 说明
storeName 证书存储区的名称。
storeLocation 证书存储区的位置。
选项 说明
/n < subjectName> 指定证书的主题名称。
/t < thumbprint> 指定证书的指纹。 使用 Certmgr.exe 来检索证书的指纹。
/f 只输出文件名。
/d 只输出目录。
/a 输出绝对文件名。

示例

以下命令将检索 John Doe 的私钥:

FindPrivateKey My CurrentUser -n "CN=John Doe"

以下命令将检索本地计算机的私钥:

FindPrivateKey My LocalMachine -t "03 33 98 63 d0 47 e7 48 71 33 62 64 76 5c 4c 9d 42 1d 6b 52" –a