Generate public key from private key in keychain
来源:互联网 发布:第十域辅助软件 编辑:程序博客网 时间:2024/06/05 15:35
ref link: http://stackoverflow.com/questions/16847081/i-lost-my-public-key-can-i-recover-it-from-a-private-key
如何通过private key来恢复public key?
public / private key都是成对生成的,但下面2种常见情况会丢失public key
1. 不小心从keychain里删掉public key
2. apple program admin会生成一个p12传给developer来通过它生成distribution ipa file,而developer在把这个p12导入到keychain之后,它只包含private key and certificate,并不包括public key。
另外如果key chain里只有private key,而没有对应的public key,那么当你right-click the private key -> "Request a certificate",就会出现error “The specified item could not be found in the keychain”
下面方法可以通过private key in keychain来生成对应的public key.
1. In Keychain Access, right click the private key and select "Export..." as eg "private.p12". 在导出过程中,你需要给该.p12 file设置一个密码,假设为 “123456”.
2. 执行下列命令把.p12 file转换成.pem file (e.g. private.pem) 。在此过程中你需要输入步骤1设置的密码,然后还需要给生成的pem file设置一个密码,假设依然为 “123456”.
openssl pkcs12 -in private.p12 -out private.pem
3. 执行下列命令来获取public key的pem file (e.g. public.pem) 。在此过程中你需要输入步骤2设置的密码
openssl rsa -in private.pem -pubout > public.pem
4. 执行下列命令把public.pem file导入到keychain tool里的"login" keychain里。
security import public.pem -k login.keychain
5. 打开keychain tool,进入"login" keychain > keys,你会看到一个“Imported public key” item,这就是步骤4导入的public key。double click it,你可以为其更改名称
6. !!注意:最后记得要清楚步骤1和2生成的private key .p12 and .pem file!!
- Generate public key from private key in keychain
- 通过public、private key登陆linux主机
- Jenkins && Pipeline Public/Private Key errors
- Xcode could not find a valid private certificate/valid key-pair for this profile in your keychain
- Get RSA public key ASN.1 encode from a certificate in DER format
- Public Key RSA Encryption in C# .NET
- 使用public/private key让putty(ssh)自动登录
- Linux Server Deployment(IV)SSH private/public key
- 使用public/private key让putty(ssh)自动登录
- 公开密匙(public key)和专用密匙(private key)
- 如何查看一个public key是否和private key是一对?
- Git generate ssh key
- [ERROR] SSL error: Unable to get private key from 'server-key.pem'
- ssh private key
- IOS Missing private key
- Public Key Infrastructure
- SSH Public Key Authentication
- OpenSSH Public Key Authentication
- 音视频播放器关键技术探讨
- 微信客户服务最难的不是功能设计和开发,而是对微信客户服务运营的理解
- X264笔记
- Git 学习笔记(基础篇)
- HDU 1212 Big Number 大数模小数
- Generate public key from private key in keychain
- 微软bing比赛,时间复杂度为8的,很有成就感的代码,结果一提交就被告知,挑战失败
- Cocos2d-x 3.0beta New Label新特性—描边,阴影,发光
- CUGB图论专场:B - ROADS(邻接表+dijkstra优先队列优化)
- div+css提高篇之position定位relative与absolute
- QT 的信号与槽机制介绍
- java jni tutorial
- POJ 1789 最小生成树(裸..当模板用把)
- devstack的重启后g-api不能启动的问题