Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Export certificate key to PEM format?

Tags:

keytool

My keystore is deleted, and I try to chat with Google playstore developer and I ask that my keystore app be reset, then they sent instructions like this:

Alternatively, you can use the following command line to generate a new key:

keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

This key must be a 2048 bit RSA key and have 25-year validity.

Export the certificate for that key to PEM format:

keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks

Reply to this email and attach the upload_certificate.pem file.

My question is how to Export the certificate for that key to PEM format?

I try to using keytool.exe in folder C:\Program Files\Android\Android Studio\jre\bin the command prompt keytool.exe can not been write (force close)

like image 371
creat15 Avatar asked Nov 06 '22 17:11

creat15


1 Answers

keytool is provided in JDK, not JRE. You can install a JDK 1.8 for example and use keytool command from the path C:\Program Files\Java\JDK_1.8\bin\keytool.exe in Windows CMD terminal in Administrator mode(preferably).

The commands you provided are meant to generate a keypair and to export the certificate. So, if you have a proper keytool installed, you can execute your commands successfully and export the certificate.

For exporting certificate, if path not given it will export the ceritificate in bin folder.

like image 126
Hichem BOUSSETTA Avatar answered Jan 01 '23 20:01

Hichem BOUSSETTA