SigTools is a command-line utility for converting a certificate into a byte array. Supported inputs are Android .apk
app files or those formatted according to Distinguished Encoding Rules (DER), which generally contain an X.509 binary certificate used for secure websites. Output is formatted as a Java class, a hexadecimal string, a base64 encoded string or a DER file and also is copied to the host-system clipboard. Optionally, the output can be written to a file.
The HEX or DER output forms of this utility can be used to create a signature file for securing apps using the Zebra Access Manager CSP.
.apk
file(s) from which to extract the signature(s)DISCLAIMER:
Zebra does not recommend using this utility for production environments. This app is an example of how to extract and generate a signature file from an app. No Zebra support or warranty is expressed or implied.
java -jar SigTools.jar COMMAND -INFORM [DER|APK] -OUTFORM [HEX|BASE64|JAVA|DER] [-OUTFILE filename] -IN FILENAME [FILENAME]...[ARGUMENTS]
GETCERT - Read the certificate
VERSION - Get the version of this JAR (requires no argument)
INFORM (required) - Format of the input file:
OUTFORM (required) - Format of the output:
.apk
fileIN (required) - A space-separated list of file names (NOTE: If name contains a space, surround name with quotes)
OUTFILE (optional) - The output file name
SigTools.jar
file to a working folder with the .apk
or DER file(s) it will operate on.test.java
in the .apk
example below) to devices as needed or paste the contents of the clipboard as needed.
WARNING:
Sample apps are for demonstration purposes only and should not be used in production environments.
// For APK files: Extract public signing certificate from an APK and create
// a JAVA class with an initialized byte array:
Java -jar SigTools.jar GetCert -INFORM APK -OUTFORM JAVA -IN test.apk -OUTFILE test.java
// Convert DER file to hexadecimal string:
Java -jar SigTools.jar GetCert -INFORM DER -OUTFORM HEX -IN test.x509.pem -OUTFILE test.hex