简体   繁体   English

从钥匙串访问中导出公钥

[英]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 您可以通过更改目录导入密钥链,目录显示在此处

keychains directory 钥匙串目录

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.

相关问题 在钥匙串访问中找不到公钥和私钥 - Public key and private key are not found in Keychain access 将OpenSSH RSA公钥/私钥对导入Apple的Keychain Access - Importing OpenSSH RSA Public / Private Key Pair into Apple's Keychain Access ios钥匙串中的公钥在每次获取时都会发生变化 - public key in ios keychain changes on each get OSX Keychain Access - 从现有的APNS私钥(Apple推送通知服务)生成CSR - OSX Keychain Access-Generate CSR from existing Private Key for APNS (Apple Push Notification Service) 从iPhone设置应用访问iOS钥匙串 - Access iOS Keychain from iPhone Settings app Iphone钥匙串访问下导出/导入证书,私钥的问题 - The issues of exporting/importing certificate , private key under keychain access for Iphone 我们可以从共享同一应用程序组的应用程序启用钥匙串共享之前访问保存的钥匙串项目吗? - Can we access keychain items that are saved before enabling keychain sharing from app sharing same app group? iPhone SDK的密钥链导出(公共密钥,私有密钥和证书,…) - KEY CHAIN export for iphone sdk (public keys and privates key and certificates,…) 我们可以从Opensssl访问iPhone钥匙串钥匙和证书吗? - Can we access iPhone keychain keys and certificates from Opensssl? 我的访问密钥链证书 - My Access KeyChain certificate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM