xcode 从钥匙串访问导出公钥
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8874164/
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
export public key from keychain access
提问by TommyG
I want to archive my app for distribution on two computers. I exported the private key successfully and imported it to my second machine, however run into errors when imported the public key.
我想存档我的应用程序以在两台计算机上分发。我成功导出了私钥并将其导入到我的第二台机器,但是在导入公钥时遇到了错误。
Everywhere I search people always mention only exporting of the private key - why is that? how can I export the public key and transfer it successfully? what am I doing wrong?
我到处搜索的人总是提到只导出私钥 - 为什么会这样?如何导出公钥并成功传输?我究竟做错了什么?
采纳答案by jimmyg
When you export you privatekey, you should get a .p12 file. Import that file on the other machine. It should have everything in it you need. You don't need to specifically export and import the publickey.
当你导出你的私钥时,你应该得到一个 .p12 文件。在另一台机器上导入该文件。它应该有你需要的一切。你不需要专门导出和导入公共密钥。
回答by DougW
It's been broken since 2009 as reflected in this bug report.
正如本错误报告中所反映的那样,它自 2009 年以来已被破坏。
In case that report wanders off the internet, here's the relevant instructions to import a public key pem file. You'll want to execute this in Terminal.
如果该报告从 Internet 上消失,这里是导入公钥 pem 文件的相关说明。您需要在终端中执行此操作。
security import pub_key.pem -k ~/Library/Keychains/login.keychain
回答by user9577488
Same as DougW,
和 DougW 一样,
But first you must directing your terminal to directory of the key
但首先您必须将终端定向到密钥目录
Then change the pub_key to the name of key you will import
然后将 pub_key 更改为您将导入的密钥的名称
Example:
例子:
your key on folder Documents, and the key name is my_login.pem
您在文件夹 Documents 上的密钥,密钥名称是my_login.pem
So, you must write in terminal
所以,你必须在终端写
$ cd Documents
$ security import my_login.pem -k ~/Library/Keychains/login.keychain
But be careful, you must need a backslash if you key name like
但要小心,如果你像这样的键名,你必须需要一个反斜杠
$ security import \<my_login.pem\> -k ~/Library/Keychains/login.keychain
Backslash for escape characteras text
转义字符作为文本的反斜杠
https://ubuntuforums.org/showthread.php?t=1976408
https://ubuntuforums.org/showthread.php?t=1976408
Don't understand the backslash here
For Your Information
供您参考
And you can import keychains with change the directory, the directory show in here
您可以通过更改目录导入钥匙串,目录显示在此处
just let your pointer on the kind of keychain you want to know
只需让您的指针指向您想知道的钥匙串类型
So it will be like this
所以会是这样
security import **yourkeyname** -k ~/Library/Keychains/System.keychain
BE CAREFULwith this
小心这个
You must know what you do
你必须知道你在做什么