Android App base 64 public key

こ雲淡風輕ζ 提交于 2019-12-08 16:19:48

问题


How do I get (or view) an Android app base 64 public key? I have the license file, and I have published my app before.

I need the key for licensing.


回答1:


To find the public licensing key for your app perform the following steps...

1.) Login to the Google Play Developer console from where you published your app

2.) Click on your app in the list of apps

3.) Click on Developer Tools on the left menu

3.) Select Services & API's

4.) Under Licensing & In-App billing you will see the public key




回答2:


To add licensing to an application, you must obtain your publisher account's public key for licensing and copy it into your application. Here's how to find your account's public key for licensing:

Go to the Google Play publisher site and sign in. Make sure that you sign in to the account from which the application you are licensing is published (or will be published). In the account home page, locate the "Edit profile" link and click it. In the Edit Profile page, locate the "Licensing" pane, shown below. Your public key for licensing is given in the "Public key" text box.

Source http://developer.android.com/guide/google/play/licensing/adding-licensing.html




回答3:


Your base64 string is possibly an X509EncodedKeySpec. I can only guess. If so, you should base64 decode the string to obtain a byte []. Then construct an X509EncodedKeySpec from this byte []. Then create an instance of an RSA KeyFactory, and use the generatePublic() method of this KeyFactory to obtain a PublicKey. This public key can then be passed to Cipher.init()



来源:https://stackoverflow.com/questions/12094455/android-app-base-64-public-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!