mercoledì 3 settembre 2014

Identity of an Android app creator

To show or verify the identity of the Android app creator, you need the Android application setup (APK file).
Each Android app (file .apk) are digitally signed with a certificate.
This certificate identifies the author of an app.

You can choose one of the following commands:

# Direct with standard Java tools
jarsigner -verify -certs -verbose file.apk

# Indirect with standard Java tools
unzip -p file.apk  META-INF/CERT.RSA \
| keytool -printcert

# Indirect with OpenSSL
unzip -p file.apk  META-INF/CERT.RSA \
| openssl pkcs7 -inform DER -print_certs -text

# Indirect with OpenSSL
unzip -p file.apk  META-INF/CERT.RSA \
| openssl pkcs7 -inform DER -print_certs -text


With OpenSSL you can retrieve more information:
# extract the certificate in PKCS#7 format
unzip -p file.apk META-INF/CERT.RSA > /tmp/cert.pkcs7
# extract the certificate in PEM format
openssl pkcs7 -inform DER -in /tmp/cert.pkcs7 -print_certs \
| tail -n +3 > /tmp/cert.pem
# dump the certificate
openssl x509 -inform PEM -in /tmp/cert.pem -text

Nessun commento:

Posta un commento