16
1月
2024
10:58

“更新证书CRL列表的BAT文件”

16 1月 2024 10:58

在检查电子签名时,在Windows下,召回证书的列表已过时”Cryptoarm 5“可能会警告说CRL列表不相关,因此我提出了一个解决方案。

介绍

crl - 过早召回的电子签名证书清单通过认证中心认证。
CRL被解密为证书吊销列表。 撤回证书的列表是PKI基础架构(可信加密密钥)的强制性部分,因为由于其崩溃或妥协(例如,损失)或所有者的死亡,可能会提前更换电子签名密钥。 证书的审查将不允许使用ED进行攻击者。

CRL列表需要经常更新 - 我为早晨每日发布更新设置了计划者。 由于仅使用当前的CRL列表,因此防止被盗或丢失的保护,阻止他人的钥匙有效。

CRL列表:
注册reest-pki.ru
“ Rostelecom” Rostelecom.ru和Company.rt.ru

任务是从这些站点之一上传文件,并导入一组证书 “撤销”

使用图形接口(MMC.EXE-设备“证书”)的证书管理并不方便,因为需要用户参与。 蝙蝠文件是在早上沿任务的计划者启动的。

启动蝙蝠文件需要什么:

1)命令文件可以在操作系统中工作:

  • Windows 7 SP1
  • Windows 10版本1507或更高版本
  • Windows 11
  • Windows Server 2022,Windows Server 2019,Windows Server 2016和Windows Server 2012 R2。

2)已安装的免费实用程序 gnu wget for Windows - 版本 wget-1.11.4-1-setup.exe или другая. Gnu Wget можно скачать на сайте SourceForge -Gnu Wget для Windows
3)命令行 certmgr.exe 来自软件包 Windows SDK。 为了易于启动,我将certmgr.exe实用程序复制到命令文件为*的文件夹中。蝙蝠。

准备

在硬盘驱动器上,我创建了 c:\ crl 文件夹(名称可以是任何东西,您需要修复蝙蝠文件文本),我在该文件中发布了一个文本命令文件,并将certmgr.exe程序从Windows SDK软件包放置。

在BAT文件附近,有三个召回证书列表的列表-list1.txt,list2.txt和list3.txt

用于更新CRL的文本命令蝙蝠文件的内容

@echo Off for /f %% g在(list1.txt)dome not:s_subrautine %% g g g g goto:eof :: S_SUBROUTINE 回声开始:%1 “ c:\ program文件(x86)\ wget \ bin \ wget.exe”%1-输出文档C:\ crl \ temp.crl c:\ crl \ certmgr.exe /add c:\ crl \ temp.crl /s ca 回声完成! 回声: 回声: del C:\ crl \ temp.crl goto:eof 输入周期指示带有证书列表的输入文件:list1.txt) 我有三个文件版本-list1.txt,list2.txt和list3.txt ### 带有CRL的URL列表的文件称为证书 内容 ** list1.txt ** :
 http://reestr-pki.ru/cdp/guc.crl
http://reestr-pki.ru/cdp/guc_gost12.crl
http://reestr-pki.ru/cdp/vguc1_3.crl
http://reestr-pki.ru/cdp/vguc1_4.crl
http://reestr-pki.ru/cdp/vguc1_5.crl 

内容 ** list2.txt ** :
 http://rostelecom.ru/cdp/guc.crl
http://rostelecom.ru/cdp/guc_gost12.crl
http://rostelecom.ru/cdp/vguc1_3.crl
http://rostelecom.ru/cdp/vguc1_4.crl
http://rostelecom.ru/cdp/vguc1_5.crl
 pre>

内容 ** list3.txt ** :
 http://company.rt.ru/cdp/guc.crl
http://company.rt.ru/cdp/guc_gost12.crl
http://company.rt.ru/cdp/vguc1_3.crl
http://company.rt.ru/cdp/vguc1_4.crl
http://company.rt.ru/cdp/vguc1_5.crl 

### 从哪里获得certmgr.exe?

已安装证书调度程序以及用于Windows 10 **的** SDK软件包。

执行的文件沿途位于Windows 10中
 **%programFiles(x86)%\ Windows套件\ 10 \ bin \ 10.0。 version_sdk.0 \ arm64 \ certmgr.exe。 ** 

加载SDK的页面:
1. 1。[Windows SDK加载](https://learn.microsoft.com/ru-ru/windows/apps/windows-app-sdk/downloads) 
2. 2。[Windows 11,版本22H2的Windows SDK(10.0.22621)](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) 

### certmgr文档

*[certmgr.exe(证书调度程序)](https://learn.microsoft.com/ru-ru/dotnet/framework/tools/certmgr-exe-certificate-manager-tool) 


相关出版物