How to Apply App Certificates

From wizarPOS
Revision as of 08:07, 11 January 2019 by Mahong (talk | contribs)
 If you want to install apk to user mode terminal, the certificate of the signing private key of the apk will be checked, it should be issued by the app root certificate. By default, there is default wizarpos root certificate in the terminal. So you should request production certificate to us for your keystore (which will be used to sign apk). The apply step is described below.
 After get the certificate from us, you should import the certificate to your keystore, then all the apk signed by this keystore can be installed to user mode terminal.

Runing Enviroment

The follow steps will run in PC, and use keytool in JDK, so please make sure you have installed the JDK in your PC.

Generate Private Keystore

 keytool -genkeypair -keystore demo.jks -keyalg RSA -keysize 2048 -alias androiddebugkey -dname "EMAILADDRESS=shan.zhang@abc.com, CN=Zhang Shan, OU=RD, O=ABC company, L=Shanghai, ST=Shanghai, C=CN"

Notes:

  • Domain name should be filled according the real information of your company. CN=commonName, OU=organizationUnit, O=organizationName, L=localityName, ST=state or province name, C=country.
  • If you want to use this keystore in Eclipse as a custom debug keystore, the alias of the key should be “androiddebugkey” and the password should be “android”. If you won’t use this keystore in Eclipse, you can use any alias name or password.

Export CSR (Certificate Signature Request)

 keytool -certreq -keystore demo.jks -alias androiddebugkey > demo.csr 

Send CSR to wizarPOS

Send CSR to support@wizarpos.com

Import the Certificate Chain

Import the replied certificate chain of the CSR(demoissuedbywizarpos.crt or *.pem), when you receive them from wizarpos.:

 keytool -importcert -keystore demo.jks -file demoissuedbywizarpos.crt -alias androiddebugkey

Notes:

  • Choose Yes, when the importing tools ask you if you want to trust them.

FAQ

Keytool

keytool.exe is in the JRE path, XXX/Java/jreXXX/bin, if you have set the enviroment variable, JAVA_HOME, you can run keytool command line in every path, or else you must run the command line in the jre path.

Keysize Problem when Generate Keypair

Please download the unlimited strength policy from java website:

Java6: http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html

Java7: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

Copy the local_policy.jar and US_export_policy.jar to the folder $JAVA_HOME/jre/lib/security

csr error

After export csr, please open the csr in Notepad, if the csr content begin with "-----BEGIN NEW CERTIFICATE REQUEST-----", end with "-----END NEW CERTIFICATE REQUEST-----", there are contents in the middle, that means the csr file is right, the others are bad csr files, then you need to check the above steps you running, find the fault step.