一个简单的问题,有一个相当复杂的答案:
如何对Java Midlet进行签名,以便在安全性提示较少的情况下将其加载到移动电话上?
发布于 2013-07-25 16:57:38
Step1:创建CSR请求,可能由
1) Creating keystore and using that generate CSR file.
2) Perform steps given by certificate authority and download CSR and private key files.Step2:将您的信息提交给证书颁发机构进行验证。
Step3:将为您提供用于代码签名的证书。
Step4:需要下载中间证书和根证书。
Step5:现在你将拥有your_domain_name.crt,IntCertCA.crt,TrustedRoot.crt
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.Step6:在您的your_domain_name.pem中导入私钥
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 )Step7:从output_file_name.p12创建密钥库
keytool -importkeystore \
-deststorepass changeit -destkeypass changeit -destkeystore your_domain_keystore.ks \
-srckeystore output_file_name.p12 -srcstoretype PKCS12 -srcstorepass your_store_password \
-alias your_aliasStep8:注意:请在触发以下命令前备份您的JAD文件。
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 Step9:注意:请在触发以下命令前备份您的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.jadhttps://stackoverflow.com/questions/1383771
复制相似问题