28 December 2011

Retrieve information from your p12 certificate

Some days ago, one of my distributors asked me a package with a 30 years long certificate. I was pretty sure my current package was long enought but I didn't remember how much so I looked for a way to get it from this cryptic p12 file.


Be sure you have a jdk and not a jre installed else keytool won't be available.
The command to read information from a .p12 certificate is
keytool -list -keystore <certificate_file>.p12 -storetype pkcs12 -v

the magic option is -v
This way you could see the full informations

My p12 was 25 years long, it seems Google asks 30 years long now

Warning : it's not possible to update the certificate, the only way is to create a new one with the same informations and 30 years validity.
Sadly, doing this cancels the update system of Android.
Current users won't be able to update your app with the previous certificate, they have to delete and redownload it.

So backup and double backup your certificate !

No comments: