如何签署Java Midlet?
一个回答相当复杂的简单问题:如何签署Java Midlet?,java,midlet,sign,Java,Midlet,Sign,一个回答相当复杂的简单问题: 如何签署Java Midlet,以便在安全提示较少的情况下将其加载到手机上?获取所需的软件 从(您应该已经有了这个) 也来自 可以选择获取和安装,并允许您自动化构建(我强烈推荐这些) 导入现有证书(如果有) 如果您从Verisign(或其他提供商)购买了证书,则需要将证书导入J2SE密钥库 尝试使用以下命令keytool-import-alias{myalias}-file{mycertificate}(由于没有正确的证书,我无法测试此命令) 运行keytoo
如何签署Java Midlet,以便在安全提示较少的情况下将其加载到手机上?获取所需的软件
keytool-import-alias{myalias}-file{mycertificate}
(由于没有正确的证书,我无法测试此命令)keytool-list
查看您的新证书keytool-export-alias{myalias}-file mycertificate.crt
keytool-genkey-alias{myalias}-keyalg RSA-validity 365
keytool-list
查看您的新证书keytool-export-alias{myalias}-file mycertificate.crt
MIDlet Jar URL
jarsigner-keystore{mykeystore}-storepass(mypassword}{myjar}{myalias}
MIDlet jar大小
java-jarjadtool.jar-addcert-alias{myalias}-storepass{mypassword}-keystore{mykeystore}-inputjad{myinputjad}-outputjad{myoutputjad}
java-jarjadtool.jar-addjarsig-alias{myalias}-jarfile{myjar}-storepass{mypassword}-keypass{mypassword}-keystore{mykeystore}-inputjad{myinputjad}-outputjad{myoutputjad}
MIDlet-Jar-URL: MyApp.jar
MIDlet-Jar-Size: 201365
MIDlet-Name: MyApp
MIDlet-Vendor: EC1M
MicroEdition-Profile: MIDP-2.0
MicroEdition-Configuration: CLDC-1.1
MIDlet-Icon: logo.png
MIDlet-Push-1: sms://:6553,net.ec1m.MyApp.midp.MyAppMIDlet,*
MIDlet-Description: MyApp MIDlet
MIDlet-Permissions: javax.microedition.io.PushRegistry,javax.microedition.io.Connector.sms...
MIDlet-Version: 1.0.67 MIDlet-1: MyApp, logo.png,net.ec1m.MyApp.midp.MyAppMIDlet
MIDlet-Certificate-1-1: MIICODCCAaECBEKqpfswDQYJKoZIhvcNAQEEBQAwYz...=
MIDlet-Jar-RSA-SHA1: EUsAch/.../hEZOsJsiCjBOhNs/3FSw4=
Manifest-Version: 1.0
MIDlet-Name: MyApp
Created-By: 1.4.2_05-b04 (Sun Microsystems Inc.)
MIDlet-Push-1: sms://:6553,net.ec1m.MyApp.midp.MyAppMIDlet,*
MIDlet-1: MyApp, logo.png, net.ec1m.MyApp.midp.MyAppMIDlet
MicroEdition-Configuration: CLDC-1.1
Ant-Version: Apache Ant 1.6.2
MIDlet-Icon: logo.png
MIDlet-Vendor: EC1M
MIDlet-Permissions: javax.microedition...
MIDlet-Version: 1.0.67
MicroEdition-Profile: MIDP-2.0
MIDlet-Description: MyApp MIDlet
1) Creating keystore and using that generate CSR file.
2) Perform steps given by certificate authority and download CSR and private key files.
Now you need to create a chained certificate by combining all above certificates.
1) Open a text editor (such as wordpad) and paste the entire body of each certificate into one text file in the following order:
The Primary Certificate - your_domain_name.crt
The Intermediate Certificate - IntCertCA.crt
The Root Certificate - TrustedRoot.crt
Make sure to include the beginning and end tags on each certificate. The result should look like this:
-----BEGIN CERTIFICATE-----
(Your Primary SSL certificate: your_domain_name.crt)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(Your Intermediate certificate: IntCertCA.crt)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(Your Root certificate: TrustedRoot.crt)
-----END CERTIFICATE-----
Save the combined file as your_domain_name.pem. The .pem file is now ready to use.
openssl pkcs12 -export -in your_domain_name.pem -inkey your_private_key.key -out output_file_name.p12 -name your_alias
NOTE: PLEASE REMOVE \ FROM FOLLOWING COMMANDS AND EXECUTE ( \ IS BASICALLY COMMAND CONTINUETY )
keytool -importkeystore \
-deststorepass changeit -destkeypass changeit -destkeystore your_domain_keystore.ks \
-srckeystore output_file_name.p12 -srcstoretype PKCS12 -srcstorepass your_store_password \
-alias your_alias
Add your certificates to your your_midlet_name.jad file.
java -jar JadTool.jar -addcert -alias your_alias \
-storepass your_store_password \
-keystore your_domain_keystore.ks \
-inputjad your_midlet_name.jad -outputjad your_midlet_name.jad
Sign your midlet, also use your_midlet_name.jad file generated from Step8.
java -jar JadTool.jar -addjarsig \
-alias your_store_password \
-storepass your_store_password \
-keypass your_store_password \
-keystore your_domain_keystore.ks \
-inputjad your_midlet_name.jad -outputjad your_midlet_name.jad