keystore to PEM file

I am trying to upload a new version of a game I built with Unity, to Google Play. The old key password has been lost so I need to use a new signing key. I have contacted Google about this and they can only reset my signature if I send them a new PEM file.

I have tried several methods of getting from the Keystore file to a PEM with no success. The last attempt I submitted to Google Play was rejected for being too weak. I have also look into using Android Studio with no success. (the online information on doing this seems to be out of date)

How can I generate a ‘.pem’ file from the ‘.keystore’ file?

I was able to solve this issue by using an open source application called KeyStore Explorer: https://keystore-explorer.org/

The app lets you open the ‘.ketstore’ file generated via Unity. You can then manage the keys and export a PEM certificate.

Note that the Unity default key pair is only 1024 bit. You need to create a new key pair at 2048 bit for Google Play when updating your public key.

Note that this solution does not require Command Line coding.

Thanks a lot. This did work for me. Just generate the new key store file, open it with KeyStore explorer, double click on it once you have it in the program window and click export. I generated the keystore file with unity 2019.2.6f1 and it was already 2048 bit RSA key. I didn’t have to create a new key par.

@bod

No need to install Keystore Explorer to get .pem from .keystore

  • Open cmd
  • Change directory to jdk/bin in my case C:\Program Files\Java\jdk1.8.0_333\bin>
  • Run this command

keytool -export -rfc -keystore “Keystore_Directory\user.keystore” -alias AliasName

  • Enter keystore password
  • Copy

-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----

  • Create a notepad file with extension .pem

  • Open file with notepad

  • Paste certificate you just create from cmd

  • Save it

Done .pem file created

Not a Unity related question. The keystore is part of java / android. 10 seconds google search gave me this:

converting-a-java-keystore-into-pem-format