Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting certificate details from an apk

How do I go about getting the details of the certificate an apk was signed with. I have a bunch of apks signed with different certificates and I am trying to group them based on their certificate.

I can get the certificate expiry details using the jarsigner and complete my task but I was curious if I can get any more details or extract the public key ( I believe it stored in META-INF/cert.RSA but it's not readable )

like image 612
Ravi Vyas Avatar asked Jul 06 '12 11:07

Ravi Vyas


People also ask

How do I analyze an APK file?

Drag an APK or app bundle into the Editor window of Android Studio. Switch to the Project perspective in the Project window and then double-click the APK in the default build/output/apks/ directory. Select Build > Analyze APK in the menu bar and then select your APK or app bundle.

What is CERT RSA in APK?

RSA" file under "./META-INF" folder for an Android application. To my understanding, "CERT. RSA" is used to verify the signiture of "CERT. SF" file under the same directory. It should consist of the certificate meta info (subject, issuer, Series number, etc.), the signature of "CERT.


2 Answers

Try the following:

openssl pkcs7 -inform DER -in CERT.RSA -noout -print_certs -text 
like image 65
Yury Avatar answered Oct 01 '22 16:10

Yury


unzip -p Name-of-apk.apk META-INF/CERT.RSA | keytool -printcert is what I used .

It produces information such as the owner, issuer, serial number, valid through, certificate fingerprints, signature algorithms and version.

like image 26
diptia Avatar answered Oct 01 '22 15:10

diptia