从 pfx 文件中提取通用名称

发布于 2024-12-02 00:03:49 字数 311 浏览 1 评论 0 原文

我使用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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愿得七秒忆 2024-12-09 00:03:49

您应该编写自己的应用程序,它将执行 PFX 文件的批处理。

使用CryptoAPI的伪代码如下。 ,

  1. 使用PFXImportCertStore。您将获得证书存储上下文。

  2. 获取证书上下文PCCERT_CONTEXT phPfxCertCtx = CertEnumCertificatesInStore

  3. 获取主题名称。 phPfxCertCtx->pCertInfo->Subject

  4. 您可以有一个预定义的主题列表来比较现在读取的主题名称。

  5. 使用 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.,

  1. Read the pfx files from disk one by one using PFXImportCertStore. You will get the certificate store context.

  2. Acquire the certificate context PCCERT_CONTEXT phPfxCertCtx = CertEnumCertificatesInStore

  3. Get the subject name. phPfxCertCtx->pCertInfo->Subject

  4. You can have a predefined list of subjects to compare the subject names that are read now.

  5. Close the context and certificate store, CertCloseStore with CERT_CLOSE_STORE_FORCE_FLAG.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文