我使用Windows XP SP3。我转售数字签名证书。我获取客户数据,将其输入门户并将 DSC 下载到我的计算机上。我使用 Internet 选项并将证书导出到带有密码的 pfx 文件,然后将其发送给客户端。因为,这是一次又一次地执行,在导出到 pfx 期间,无意中选择了错误的证书。生成 pfx 文件后,有什么方法可以知道 pfx 文件中的通用名称,而无需重新安装证书。我研究过 openssl,但不确定是否可以通过批处理文件来实现,因为必须实际输入密码。理想情况下,在导出 10 个 pfx 文件后,我想运行一个仅显示常用名称的批处理文件。一旦我确认名称正确(我已正确导出),我就可以从存储中删除证书。
I use Windows XP SP3. I resell digital signature certificates. I get the clients data, key them into a portal and download the dsc onto my machine. I use Internet Options and export the certificate to a pfx file with a password and send it off to the client. Since, this is being done over and over again, during export to pfx, inadvertently the wrong certificate is selected. Once the pfx file is generated, is there any way of knowing the common name in the pfx file without having to reinstall the certificate. I have looked into openssl, but not sure if it can be achieved by a batch file as a password has to be physically entered. Ideally, after exporting say 10 pfx files, I would like to run a batch file which would display only the common names. Once I confirm that the names are correct (I have exported correctly), I can delete the certificates from the store.
发布评论
评论(1)
您应该编写自己的应用程序,它将执行 PFX 文件的批处理。
使用CryptoAPI的伪代码如下。 ,
使用PFXImportCertStore。您将获得证书存储上下文。
获取证书上下文PCCERT_CONTEXT phPfxCertCtx = CertEnumCertificatesInStore
获取主题名称。 phPfxCertCtx->pCertInfo->Subject
您可以有一个预定义的主题列表来比较现在读取的主题名称。
使用 CERT_CLOSE_STORE_FORCE_FLAG 关闭上下文和证书存储 CertCloseStore。
You should write your own application, that will perform batch processing of PFX files.
The pseudo code using CryptoAPI are as follows.,
Read the pfx files from disk one by one using PFXImportCertStore. You will get the certificate store context.
Acquire the certificate context PCCERT_CONTEXT phPfxCertCtx = CertEnumCertificatesInStore
Get the subject name. phPfxCertCtx->pCertInfo->Subject
You can have a predefined list of subjects to compare the subject names that are read now.
Close the context and certificate store, CertCloseStore with CERT_CLOSE_STORE_FORCE_FLAG.