How to Apply App Certificates: Difference between revisions

From wizarPOS
No edit summary
Line 4: Line 4:
The follow steps will run in PC, and use keytool in JDK, so please make sure you have installed the JDK in your PC.
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 ==
== 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"'''
   '''keytool -genkeypair -keystore '''demo.jks''' -keyalg RSA -keysize 2048 -alias androiddebugkey -dname "EMAILADDRESS=myname@abc.com, CN=MyName, OU=RD, O=ABC company, L=Shanghai, ST=Shanghai, C=CN"'''
'''Notes''':
'''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.
* 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 key store in Eclipse as a custom debug key store, the alias of the key should be “androiddebugkey” and the password should be “android”. If you won’t use this  key store in Eclipse, you can use any alias name or password.
* EMAILADDRESS must be filled by company official email address.
* If you want to use this key store in Eclipse as a custom debug key store, the alias of the key should be “androiddebugkey” and the password should be “android”. If you won’t use this  key store in Eclipse, you can use any alias name or password.


== Export CSR (Certificate Signature Request) ==
== Export CSR (Certificate Signature Request) ==

Revision as of 09:30, 24 April 2019

 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 key store (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 key store, then all the APK signed by this key store can be installed to user mode terminal.

Running Environment

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=myname@abc.com, CN=MyName, 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.
  • EMAILADDRESS must be filled by company official email address.
  • If you want to use this key store in Eclipse as a custom debug key store, the alias of the key should be “androiddebugkey” and the password should be “android”. If you won’t use this key store 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 environment 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.