如何从key.pk8和certificate.pem生成Android Keystore? [英] How can I generate an Android Keystore from a key.pk8 and certificate.pem?

查看:348
本文介绍了如何从key.pk8和certificate.pem生成Android Keystore?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以今天我终于将我的SDK更新到22.0.0,但这在android:debuggable="false"的AndroidManifest.xml中创建了一个错误,这意味着我无法再从外部对自己的apk进行签名和压缩.

So today I finally update my SDK to 22.0.0 however this creates an error in the AndroidManifest.xml for android:debuggable="false" which means I can no longer externally sign and zipalign my own apks.

我一直使用自己的key.pk8和certificate.pem进行签名,但是Eclipse ADT需要一个密钥库.

I have been signing using my own key.pk8 and certificate.pem, however eclipse ADT requires a keystore.

有人知道使用我已经生成的密钥来构建密钥库还是找到解决方法的方法吗?

Does anyone know a way to either build a keystore using my already generated key or find some way around this?

推荐答案

好,所以我最终设法解决了这个问题.

Ok, So I eventually managed to solve the problem.

我从此处

可以在E:\Program Files\Java\jdk1.7.0_17\bin

然后使用keytool和openssl设法将key.pk8和certificate.pem构建到密钥库条目中

Then using keytool and openssl managed to build the key.pk8 and certificate.pem into a keystore entry

openssl pkcs8 -inform DER -nocrypt -in key.pk8 -out key.pem

openssl pkcs12 -export -in certificate.pem -inkey key.pem -out platform.p12 -password pass:android -name mykey

keytool -importkeystore -deststorepass password -destkeystore .keystore -srckeystore platform.p12 -srcstoretype PKCS12 -srcstorepass android

keytool -list -v -keystore .keystore

最后一步只是验证密钥是否已添加到密钥库中.

The last step is just to verify that the key has been added to the keystore.

这篇关于如何从key.pk8和certificate.pem生成Android Keystore?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆