Estou fazendo uma aplicação para o celular utilizando o eclipse e o wtk, essa minha aplicação terá que se comunicar com um site que já possui um certificado de segurança SSL, por enquanto só estou com os testes no emulador, o problema é que li em um artigo da sun que preciso configurar o wtk para ele puder emular um tipo de aplicação como essa e infelizmente não estou conseguindo executar o procedimento que a sun pedi para fazer, logo na primeira parte que preciso fazer já me deparo com um erro dizendo que o comando não é reconhecido, eu to achando que tenho que configurar algo antes, instalar mais algo porem não to conseguindo achar nada na net que possa me auxiliar.
O artigo da sun que fala sob isso é: http://developers.sun.com/mobility/midp/articles/https/
o ponto exato que fala sob o assunto no site da sun é: Example 4: Importing Certificates
Estou mandando abaixo extamente o que fala no artigo:
" Example 4: Importing Certificates
Now let’s revise HelloNet MIDlet to request the URL https://127.0.0.1/hello.txt:
-
Using your favorite text editor, create a file containing the following text:
Hello there. SSL is working.
Enjoy!Save the file as c:\tomcat\webapps\root\hello.txt. To test it, request it from an ordinary browser using the URL https://127.0.0.1/hello.txt.
-
Change the url in Code Sample 1 from https://central.sun.net to https://127.0.0.1/hello.txt. Save the HelloNet MIDlet, build it, run it, and activate it.
When you activate the MIDlet, you will encounter an exception that reports a bad certificate. Why? Well, the certificate for Tomcat was self-issued and therefore not trusted by the J2ME Wireless Toolkit.
Luckily, the J2ME Wireless Toolkit includes a tool called MEKeyTool (Mobile Equipment Key Tool), which is similar to J2SE’s keytool. The purpose of this certificate-manager utility is to manage the public keys of certificate authorities.
MEKeyTool is packaged as a JAR file. To use it, you must change directories to c:\wtk104 and use this command:
jar -jar bin/MEKeyTool.jar
You’ll use the argument to direct the utility to import, delete, or list public keys for certificates.
The default MEKeyTool keystore is c:\wtk104\appdb_main.ks. You need to know this location because you will use it when deleting, listing, and importing keys. To list the keys in the default MEKeyTool keystore, use the command:
java -jar bin\MEKeyTool.jar -list
This command will display all the public keys for trusted certificates. Note that if you execute this command from any other directory you will need to use the -MEkeystore option and specify the full path to the MEKeyTool keystore.
To delete a key from the default keystore with the given owner, use the following command:
java -jar bin\MEKeyTool.jar -delete -owner
Finally, to import a public key into the default keystore from a keystore managed by keytool, use this command:
java -jar bin\MEKeyTool.jar -import -alias -keystore -storepass
For example, I used the following command to import the Tomcat public key into the MEKeyTool keystore:
java -jar bin\MEKeyTool.jar -import -alias tomcat -keystore “c:\documents and settings\qmahmoud.keystore” -storepass changeit
If the command is successful, you see no output, but it’s easy to see whether Tomcat’s public key is now in the key list: just run the list command again.
Once the Tomcat public key has been imported into the MEKeyTool keystore, restart the HelloNet MIDlet and activate it. If all goes well, you will see the contents of hello.txt.
Alguem já passou por isso ou tem como me ajudar.
Obrigada