重新安装 .cer Apple“开发者 ID 安装程序”备份中的证书

发布于 2025-01-13 12:12:46 字数 1338 浏览 4 评论 0原文

假设 Apple 开发者计划会员资格已过期,因此无法从 Apple 网站请求新的代码签名证书。我仍然有以下备份:

  • developerID_application.cerdeveloperID_installer.cer(过期日期为2024,因此仍然有效
  • ) 2 年前的 CertificateSigningRequest.certSigningRequest 文件,该文件与 .cer 文件完全在同一时间创建

如何在新的 Mac 安装上安装这些证书,以便我们可以使用productsign 与他们签署 .pkg 安装程序?

这是我尝试过的:

结果:

productsign:错误:无法找到“开发人员 ID 安装者:MyName”的适当签名身份

我已经查看了 OS X 产品签名错误:找不到适当的签名身份,但它在这里没有帮助:我只有 2 个 .cer 文件和 .certSigningRequest 文件。我没有其他私钥文件。另外,当我打开 .certSigningRequest 文件时,我看到:

请为 MyName 的证书请求指定颁发证书颁发机构
颁发 CA:让我选择
你想做什么?
为自己创建证书
创建 CA
使用您的 CA 为其他人创建证书
向现有 CA 请求证书
设置默认 CA
查看和评估证书

如何处理之前的 .certSigningRequest 文件?

Let's say an Apple developer program membership has expired, so new code signing certificates cannot be requested from the Apple site. Still I have a backup of:

  • developerID_application.cer, developerID_installer.cer (and the expiration date is 2024, so it is still valid)
  • a CertificateSigningRequest.certSigningRequest file from 2 years ago, that was created exactly at the same time than the .cer files

How to install these certificates on a new Mac installation, such that we can use productsign to sign a .pkg installer with them?

Here is what I tried:

Result:

productsign: error: Could not find appropriate signing identity for "Developer ID Installer: MyName"

I have looked at OS X productsign error: Could not find appropriate signing identity but it does not help here: I only have the 2 .cer files and the .certSigningRequest file. I don't have another Private key file. Also when I open the .certSigningRequest file, I see:

Please specify the issuing Certificate Authority for MyName's certificate request
Issuing CA: Let me choose
What would you like to do?
Create a certificate for yourself
Create a CA
Use your CA to create a certificate for someone else
Request a certificate from an existing CA
Set the default CA
View and evaluate certificates

What to do with this previous .certSigningRequest file?

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

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

发布评论

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

评论(1

眼泪淡了忧伤 2025-01-20 12:12:46

如果您只有这 3 个命名文件,则您无能为力。

  • *.cer,只是由其他人(CA)签名的公钥和一些属性。
  • *.certSigningRequest,从名称猜测,是一个 PKCS#10 - 公钥和一些请求由其他人(CA)签名的属性。

您需要的是私钥。

如果您有一个正在运行的系统或完整的系统映像备份(要恢复)以及钥匙串中的私钥(~/Library/Keychains/login.keychain-db),您可以将它们导出以移动到另一个系统:

  • 启动 XCode。
  • 在菜单中单击 Xcode > 首选项
  • 点击帐户(窗口顶部)。
  • 单击齿轮图标(位于左下角“删除”按钮的右侧)。
  • 从弹出菜单中选择导出开发者帐户
  • Xcode 对导出的文件 (*.developerprofile) 进行加密/密码保护。

There is nothing you can do, if the 3 named files is all you have.

  • *.cer, Is just the public key and some attributes signed by someone else (a CA).
  • *.certSigningRequest, guessed from the name, is a PKCS#10 - public key and some attributes requested to be signed by someone else (a CA).

What you need is the private key.

If you have a system running or a full system image backup (to be restored) with the private keys in the keychain (~/Library/Keychains/login.keychain-db) you can export them to move to another system:

  • Start XCode.
  • In the Menu click Xcode > Preferences.
  • Click Accounts (top of the window).
  • Click the gear icon (right of the Delete button in the lower-left corner).
  • Choose Export Developer Accounts from the pop-up menu.
  • Xcode encrypts/password-protects the exported file (*.developerprofile).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文