macos 发生了错误。无法导入项目。无法检索此项目的内容。缺少 .pem 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6076448/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
An error has occurred. Unable to import an item. The contents of this item cannot be retrieved. Missing .pem file
提问by Raj Pawan Gumdal
I am struck with a problem. I installed the p12 certificates once into a MacBookPro and then deleted it, now when I am again trying to install it. Keychain is simply not accepting the certificate for strange reason.
我被一个问题震惊了。我曾经将 p12 证书安装到 MacBookPro 中,然后将其删除,现在当我再次尝试安装它时。由于奇怪的原因,钥匙串根本不接受证书。
After some googling, I hit upon this link: http://www.openradar.me/7092640
经过一番谷歌搜索,我找到了这个链接:http: //www.openradar.me/7092640
Which clearly says that there is a bug with Keychain and states a workaround too. But unfortunately I do not have the .pem file, since I have not made a backup of it thinking that p12 file is sufficient (which actually is, if not for this bug!). So how do I get the .pem file so that I can install the certificates back onto the same laptop using this workaround?
这清楚地表明 Keychain 存在一个错误,并说明了一个解决方法。但不幸的是我没有 .pem 文件,因为我没有备份它,认为 p12 文件就足够了(如果不是这个错误,实际上是这样!)。那么如何获取 .pem 文件,以便可以使用此解决方法将证书重新安装到同一台笔记本电脑上?
Thanks for any suggestions / ideas. Raj
感谢您的任何建议/想法。拉吉
采纳答案by Walt Sellers
When you request a certificate, your Mac creates a public/private pair that will be used to download the certificate from Apple. This is why you can't download the resulting certificate from another Mac that doesn't have the original pair.
当您请求证书时,您的 Mac 会创建一个公共/私人对,用于从 Apple 下载证书。这就是您无法从另一台没有原始证书的 Mac 下载生成的证书的原因。
If you deleted the original pair, you have to re-import it first. If you don't have both halves of the pair, you may have request a new certificate from scratch.
如果删除了原始对,则必须先重新导入它。如果您没有这对的两半,您可能需要从头开始申请新证书。
If you have the originals and it won't import them to the login keychain, you might try creating a new keychain to use in the account with the "KeyChain Access" utility. If it imports the information, the Mac should be able to find it as long as you leave the new keychain open.
如果您有原件并且它不会将它们导入登录钥匙串,您可以尝试使用“钥匙串访问”实用程序创建一个新的钥匙串以在帐户中使用。如果它导入了信息,只要您将新钥匙串保持打开状态,Mac 就应该能够找到它。
回答by Gili
Quoting http://www.openradar.me/7092640:
引用http://www.openradar.me/7092640:
You can use the 'security' command line tool:
security import priv_key.p12 -k ~/Library/Keychains/login.keychain
security import pub_key.pem -k ~/Library/Keychains/login.keychain
您可以使用“安全”命令行工具:
security import priv_key.p12 -k ~/Library/Keychains/login.keychain
security import pub_key.pem -k ~/Library/Keychains/login.keychain
https://stackoverflow.com/a/16847082/14731contains a similar answer.
回答by Mr. G
1., open Keychain Access. 2., On the Keychains panel right click on login. Select Lock Keychain "login". 3., Then unlock it. Then the import should work.
1.,打开钥匙串访问。2.,在钥匙串面板上右键单击登录。选择锁定钥匙串“登录”。3.,然后解锁。然后导入应该工作。