..

Easiest way to extract certificate information from android application

unzip -l <file> | grep -i rsa | cut -d'/' -f2 | xargs -I{} unzip -p <file> META-INF/{} | keytool -printcert

Example Output:

Ramadhan:~ rz$ unzip -l Cyber999-release\ v2.apk | grep -i rsa | cut -d'/' -f2 | xargs -I{} unzip -p Cyber999-release\ v2.apk META-INF/{} | keytool -printcert 
Owner: CN=MyCERT, OU=Cyber999, O=CyberSecurity Malaysia, L=Seri Kembangan, ST=Selangor, C=MY
Issuer: CN=MyCERT, OU=Cyber999, O=CyberSecurity Malaysia, L=Seri Kembangan, ST=Selangor, C=MY
Serial number: 52b13a15
Valid from: Wed Dec 18 14:00:53 MYT 2013 until: Sun May 05 14:00:53 MYT 2041
Certificate fingerprints:
  MD5:  9B:7C:68:A0:8F:BB:BE:8F:C7:40:BB:CD:53:1B:69:D7
  SHA1: A6:A9:A1:67:0A:1F:07:07:0B:9E:4E:74:B2:86:2B:D4:B6:79:05:83
  Signature algorithm name: SHA1withRSA
  Version: 3