javaandroidpemhuawei-developersjks

Cannot generate .pem from new .jks file


I want to upload a new app to Huawei App Gallery. To do so, you have to upload a .pem file. According to documentation from Android and Huawei, this is done like so:

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

However, when I try and doo this on my brand new .jks file generated using Android Studio, I get: "keytool error: java.io.IOException: Invalid keystore format"

It works fine on other, older, .jks files though.

I have no idea what to do. The best I can find is that 'Android Studio now runs on JDK 11'; but I don't know why that would make the jks unreadable for the keytool.

I've tried:

UPDATE: As recommended by Robert, I downloaded keystore-explorer and saw that the '.jks' is actually a .p12 file. enter image description here

Will investigate and update as soon as I figure out how to get the .pem out of it.


Solution

  • If you can use KeysTore Explorer it does all the tricky staff for you.

    Keystore Explorer

    It's free and helps a lot

    https://keystore-explorer.org/