正文
cmd命令行安装,删除Windows证书(certgmr的简单使用)
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
在管理证书的时候需要用到certmgr工具。
在cmd中执行certmgr会弹出证书管理的工具,但是不能用命令行去管理证书,需要额外的工具
cermgr.exe:下载链接
https://pan.baidu.com/s/1wnA-i0ixhSftPsMxv8OQ-Q
在certmgr文件目录下执行certmr.exe ****即可
例:删除指定证书:
CertMgr.Exe -del -c -n 证书名 -s my
添加指定证书:
CertMgr.Exe -add -all 证书名 -s my
一下为certmgr各选项的介绍:
/add | 将证书、CTL 和 CRL 添加到证书存储区中。 |
/all | 当与 /add 一起使用时添加所有项。当与 /del 一起使用时删除所有项。不带 /add 或 /delete 选项使用时显示所有项。/all 选项不能与 /put 一起使用。 |
/c | 当与 /add 一起使用时添加证书。当与 /del 一起使用时删除证书。当与 /put 一起使用时保存证书。不带 /add、/delete 或 /put选项使用时显示证书。 |
/CRL | 添加或删除 CRL。不带 /add、/delete 或 /put 选项使用时显示 CRL。 |
/CTL | 添加或删除 CTL。不带 /add、/delete 或 /put 选项使用时显示 CTL。 |
/delete | 从指定的证书存储区中删除证书、CTL 和 CRL。 |
/e encodingType | 指定证书编码类型。 |
/f dwFlags | 指定存储区打开标志。这是传递到 CertOpenStore 的 dwFlags 参数。默认值为 CERT_SYSTEM_STORE_CURRENT_USER。仅当使用 /y 选项时才考虑此选项。 |
/h[elp] | 显示该工具的命令语法和选项。 |
/n commonName String | 指定要添加、删除或保存的证书的公共名。此选项只能用于证书,不能用于 CTL 或 CRL。 |
/put | 将证书存储区中的 X.509 证书、CTL 或 CRL 保存到文件。该文件将以 X.509 格式保存。/7 选项可与 /put 选项一起使用以 PKCS #7 格式保存文件。/put 选项后面必须有 /c、/CTL 或 /CRL。/all 选项不能与 /put 一起使用。 |
/r registry location | 标识系统存储区的注册表位置。仅当指定 /s 选项时才考虑此选项。Registry location 必须是下列值之一:
|
/s | 指示证书存储区是系统存储区。如果不指定此选项,则该存储区为 StoreFile。 |
/sha1 sha1Hash | 指定要添加、删除或保存的证书、CTL 或 CRL 的 SHA1 哈希。 |
/v | 指定详细模式;显示有关证书、CTL 和 CRL 的详细信息。此选项不能与 /add、/delete 或 /put 选项一起使用。 |
/y storeProviderType | 指定存储区提供程序类型。 |
/7 | 将目标存储区保存为 PKCS#7 对象。 |
/? | 显示该工具的命令语法和选项。 |