重新安装 .cer Apple“开发者 ID 安装程序”备份中的证书
假设 Apple 开发者计划会员资格已过期,因此无法从 Apple 网站请求新的代码签名证书。我仍然有以下备份:
developerID_application.cer
、developerID_installer.cer
(过期日期为2024,因此仍然有效- ) 2 年前的
CertificateSigningRequest.certSigningRequest
文件,该文件与 .cer 文件完全在同一时间创建
如何在新的 Mac 安装上安装这些证书,以便我们可以使用productsign
与他们签署 .pkg 安装程序?
这是我尝试过的:
- 在“系统”钥匙串中导入 .cer 文件,似乎成功了
- 在钥匙串中导入 AppleWWDRCA.cer我在创建这些证书时使用的(https://developer.apple.com/certificationauthority/AppleWWDRCA.cer),同上
productsign --sign "开发人员 ID 安装程序:MyName" myinstaller.pkg myinstaller_signed.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:
- Import the .cer files in the "System" Keychain, it seems successful
- Import the AppleWWDRCA.cer in the Keychain that I used at the creation time of these certificates (https://developer.apple.com/certificationauthority/AppleWWDRCA.cer), idem
productsign --sign "Developer ID Installer: MyName" myinstaller.pkg myinstaller_signed.pkg
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只有这 3 个命名文件,则您无能为力。
您需要的是私钥。
如果您有一个正在运行的系统或完整的系统映像备份(要恢复)以及钥匙串中的私钥(~/Library/Keychains/login.keychain-db),您可以将它们导出以移动到另一个系统:
Xcode
>首选项
。帐户
(窗口顶部)。齿轮图标
(位于左下角“删除”按钮的右侧)。导出开发者帐户
。There is nothing you can do, if the 3 named files is all you have.
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:
Xcode
>Preferences
.Accounts
(top of the window).gear icon
(right of the Delete button in the lower-left corner).Export Developer Accounts
from the pop-up menu.