[英]export public key from keychain access
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?
我究竟做错了什么?
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. 如果报告偏离互联网,这里是导入公钥pem文件的相关说明。 You'll want to execute this in Terminal.
您将要在终端中执行此操作。
security import pub_key.pem -k ~/Library/Keychains/login.keychain
When you export you private key, you should get a .p12 file. 当您导出私钥时 ,您应该获得.p12文件。 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 public key.
你不需要专门导出和导入公共密钥。
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 您在文件夹文件上的键,键名是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 character as 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 CAREFUL with this 小心这一点
You must know what you do 你必须知道你做了什么
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.