• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Please Help!!!

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need an applet to be signed in order to be able to give it permissions to read from the local file system and be able to upload the selected file ( I am using file chooser). what I need to know is that how to sign my applet (free certificate) using the easiest way. I don't want each client machine to have the files. so I want to use plug-in 1.3 because I knew that it is a new feature of this plug-in version. if any one have other suggestion , I will be grateful. Please provide me with the required steps that signs my applet!
Thanks,
Jimi.
 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, Jimi,
Here is a piece of code you may use in your case. I use it with applet-java (socket commun) and it works.
You need copy program file\netscape\java\java40 into jdk\jre\\lib\ext.

try
{
try
{
PrivilegeManager.enablePrivilege ("UniversalFileAccess");
input = new BufferedReader(new FileReader(sourceFileString));
outputFile = new File(destFileString);
output= new BufferedWriter(new FileWriter(outputFile));
while ((line = input.readLine())!=null) {
output.write(line, 0, line.length());
output.newLine();
output.flush();
}
}
catch (SecurityException e)
{
System.out.println("Read/WriteFile\n: caught SecurityException");
return false;
}
catch (IOException ioe)
{
System.out.println("Read/WriteFile\n: caught IOException");
return false;
}
PrivilegeManager.revertPrivilege ("UniversalFileAccess");
}
catch(ForbiddenTargetException fte)
{
System.out.println("WriteFile\n: caught ForbiddenTargetException");
return false;
}
</code>
 
Jimi Rock
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Simon,
but excuse me,you didn't mention any steps for doing the signning process.
Please tell me what your code represents? and where to add it?
 
Jimi Rock
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again,
sorry Simon,but what if I would like to use testing cert with netscape 4 or explorer 5. is it important to have plug-in 1.3? do you know if it is included in netscape 6 or not?
Thanks,
Jimi.
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, Jimi,

There are some posts in the forum regarding the steps to do the signning process. Just search this forum.
Simon
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jimi,
Have you managed to get the file uploading? I'm trying to do the same thing and am having a tough time getting the applet to upload the file to the server. Any help would be greatly appreciated.
To create a signed applet:
Internet explorer requires a cabinet file (.cab), created using cabarc.
eg.
cabarc -r -p n c:\imageupload\imageuploadapplet.cab c:\imageupload\*.class
then sign the .cab file using signcode
eg.
signcode c:\imageupload\imageuploadapplet.cab
these tools are part of the Microsoft SDK available from the microsoft site.
Netscape however requires a signed jar file
so use the jar tool
eg.
jar cvf c:\imageupload\imageuploadapplet.jar imageupload\*.class
and the jarsigner tool
eg.
jarsigner -storepass pword c:\imageupload\imageuploadapplet.jar keyalias
you need to create a keystore first by using something like this...
keytool -genkey -alias "whateverYouWant"
then if you want to add another key you use
keytool -genkey -alias "anotherName" -keystore whateverYouCalledTheKeystore
these tools can be found in JDK 1.2

I think this should work
If the applet is for internet use, you might need to obtain a certificate from somewhere like verisign, so people know that the applet is authentic.
Daniel
 
Jimi Rock
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Daiel,
Sorry for late reply,Please provide me with extra info about your problem of file uploading using Applet.
I have signed my applet successfully but on "appletviewer" ,and it is able to upload files using servlet.
I don't know if you have taken a look on the "servlet and jsp" forum under the "Urgent" topic that was posted by me .
Regarding the signning applet process under Netscape, I want you to know that I have done the signning step by step , but it is not working .
I would be grateful if you can help. note that I am using Netscape 6 and a testing cert. the message that appears on netscape is "applet not inited" .
Thanks,
Jimi.
 
Jimi Rock
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No comments ?
Please help , please!
Thanks...
 
You can't have everything. Where would you put it?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic