How do I sign an applet?

Hi! I have an applet that is writing and reading files. How do I sign the applet so that I can do this?

Hi there Virum....
Funny I was just answering a similar question about signing an applet - see link below:
http://forum.java.sun.com/thread.jsp?forum=31&thread=220356
I have write a file I/O demo applet that you can take a look at:
http://home.attbi.com/~aokabc/FileIO/FileIOdemo.htm
You said your applet does some writing.....if it's writing to the user's disk and the user grants you the permission, you will be able to do it..but if writing to the server is what you wanted to do, then you will need help from a server-side software like a servelet, ASP or cgi.
How are you coming along with your game design!
;o)
V.V.

Similar Messages

  • How can I sign My applet for IE and Netscape without JavaPlugIn?

    I think we can sign our applets with Javasigner.exe but this certificate is not being
    supported by IE and Netscape. If you want to use this certificate with IE and Nets.
    you must install JavaPlugIn to all users. I dont want to choose this way.
    I think we have one alternative for this purpose.
    For Netscape: Signing Tool
    For IE: The program that included SDK-Java
    But I could not find SDK-Java any where.
    I think Microsoft have gave up to support the Java certification...
    I am not sure.
    How can I prepare signed applet that can be run on IE and Netscape?
    This applet will have some permissions.

    The tool you need for signing cab files for the MS JVM is signtool.exe. I beleive that the .NET version of this tool can be used, as the signing process was not Java specific. You do need certificates in a different format than for jarsigner or the netscape signing tool. Verisign will happily sell you two different certificates, but there is probably a way to convert between formats using openssl or similar.
    You'll also need to package your files in a cab instead of a jar. cabarc.exe is what we use here. Again, it does not seem to be Java specific, so you can probably still find it despite Microsoft no longer making their Java tools available.

  • How to sign java applet policy to end user?

    i have putted my applet class on server, i want all end users can access it on server, how to sign the java.policy to there JRE?
    can anyone help me?

    I found this some where else. It shows how to sign an applet.
    START OF DOC
    How To Sign a Java Applet
    The purpose of this document is to document the steps required to sign and use an
    applet using a self-signed cert or CA authorized in the JDK 1.3 plugin.
    The original 9 steps of this process were posted by user irene67 on suns message forum:
    http://forums.java.sun.com/thread.jsp?forum=63&thread=132769
    -----begin irene67's original message -----
    These steps describe the creation of a self-signed applet. This is useful for testing purposes. For use of public reachable applets, there will be needed a "real" certificate issued by an authority like VeriSign or Thawte. (See step 10 - no user will import and trust a self-signed applet from an unkown developer).
    The applet needs to run in the plugin, as only the plugin is platform- and browser-independent. And without this indepence, it makes no sense to use java...
    1. Create your code for the applet as usual.
    It is not necessary to set any permissions or use security managers in
    the code.
    2. Install JDK 1.3
    Path for use of the following commands: [jdk 1.3 path]\bin\
    (commands are keytool, jar, jarsigner)
    Password for the keystore is any password. Only Sun knows why...
    perhaps ;-)
    3. Generate key: keytool -genkey -keyalg rsa -alias tstkey
    Enter keystore password: *******
    What is your first and last name?
    [Unknown]: Your Name
    What is the name of your organizational unit?
    [Unknown]: YourUnit
    What is the name of your organization?
    [Unknown]: YourOrg
    What is the name of your City or Locality?
    [Unknown]: YourCity
    What is the name of your State or Province?
    [Unknown]: YS
    What is the two-letter country code for this unit?
    [Unknown]: US
    Is CN=Your Name, OU=YourUnit, O=YourOrg, L=YourCity, ST=YS, C=US
    correct?
    [no]: yes
    (wait...)
    Enter key password for tstkey
    (RETURN if same as keystore password):
    (press [enter])
    4. Export key: keytool -export -alias tstkey -file tstcert.crt
    Enter keystore password: *******
    Certificate stored in file tstcert.crt
    5. Create JAR: jar cvf tst.jar tst.class
    Add all classes used in your project by typing the classnames in the
    same line.
    added manifest
    adding: tst.class(in = 849) (out= 536)(deflated 36%)
    6. Verify JAR: jar tvf tst.jar
    Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/
    68 Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/MANIFEST.MF
    849 Thu Jul 27 12:49:04 GMT+02:00 2000 tst.class
    7. Sign JAR: jarsigner tst.jar tstkey
    Enter Passphrase for keystore: *******
    8. Verifiy Signing: jarsigner -verify -verbose -certs tst.jar
    130 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/MANIFEST.MF
    183 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/TSTKEY.SF
    920 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/TSTKEY.RSA
    Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/
    smk 849 Thu Jul 27 12:49:04 GMT+02:00 2000 tst.class
    X.509, CN=Your Name, OU=YourUnit, O=YourOrg, L=YourCity, ST=YS, C=US
    (tstkey)
    s = signature was verified
    m = entry is listed in manifest
    k = at least one certificate was found in keystore
    i = at least one certificate was found in identity scope
    jar verified.
    9. Create HTML-File for use of the Applet by the Sun Plugin 1.3
    (recommended to use HTML Converter Version 1.3)
    10. (Omitted See Below)
    -----end irene67's original message -----
    To make the plug-in work for any browser you have two options with the JDK 1.3 plugin.
    1) Is to export a cert request using the key tool and send it to a CA verification source like verisign.
    When the reponse comes back, import it into the keystore overwriting the original cert for the generated key.
    To export request:
    keytool -certreg -alias tstkey -file tstcert.req
    To import response:
    keytool -import -trustcacerts -alias tstkey -file careply.crt
    An applet signed with a cert that has been verified by a CA source will automatically be recognized by the plugin.
    2) For development or otherwise, you may want to just use your self-signed certificate.
    In that case, the JDK 1.3 plugin will recognize all certs that have a root cert located in the JDK 1.3 cacerts keystore.
    This means you can import your test certificate into this keystore and have the plugin recognize your jars when you sign them.
    To import self-signed certificate into the cacerts keystore, change directory to where the JDK plugin key store is located.
    For JDK 1.3.0_02: C:\Program Files\JavaSoft\JRE\1.3.0_02\lib\security
    For JDK 1.3.1: C:\Program Files\JavaSoft\JRE\1.3.1\lib\security
    Import your self-signed cert into the cacerts keystore:
    keytool -import -keystore cacerts -storepass changeit -file tstcert.crt
    (the password is literally 'changeit')
    Now, regardless of which method you use, the applet should be recognized as coming from a signed jar. The user can choose to activate it if he / she chooses. If your applet uses classes from multiple jars, for example Apache's Xerce's parser, you will need to sign those jars as well to allow them to execute in the client's brower. Otherwise, only the classes coming from the signed jar will work with the java.security.AllPermission setting and all other classes from unsigned jars will run in the sandbox.
    NOTE: Unless otherwise specified by the -keystore command in all keytool and jarsigner operations, the keystore file used is named '.keystore' in the user's home directory.
    The first time any keystore is accessed (including the default) it will be created and secured with the first password given by the user. There is no way to figure out the password if you forget it, but you can delete the default file and recreate it if necessary. For most operations, using the -keystore command is safer to keep from cluttering or messing up your default keystore.

  • I don't understand how to sign an applet

    Hi
    could you indicate me how to sign an applet or documentation which deals with this subject...
    Thanx

    I assume that by now your applet is signed and that it can be loaded into the browser and that the Java-plug-in will do something with your applet.
    Look into the Java console after your applet has stopped running. (There is a coffee mug at the lower right corner of the screen).
    For debugging an applet this Java console is quite practical.
    If issued from within an applet, statements like
    System.out.println("Some info for debugging\n");
    will print into the Java console. You can also use that in a catch-part of a try-catch-finally construct:
    try {
        // some method which may raise an exception
    catch( Exception e ) {
        System.out.println(" * ooops * " + e.getMessage() + "\n");
    }

  • How to create signed applet and make it work with browser

    i hav an applet that needs to write a file to onto local system resource. i came to know that the applet needs to be signed. so i searched some guides to create a signed applet but most of them specify how to use it with applet viewer and not on a browser. plz help me with how to sign an applet and and allow it to write a file from within a browser.

    On linux, something like this:
    keytool -genkey -alias signSocket -keystore socketstore -keypass abc123 -dname "cn=your name" -storepass abc123
    jar cvf Socket.jar *.class
    jarsigner -keystore socketstore -storepass abc123 -keypass abc123 -signedjar SSocket.jar Socket.jar signSocket
    And in html:
    CODE = "YourClass.class"
    ARCHIVE = "SSocket.jar"
    ...

  • How to sign the applet with verisign certificate?

    Hi,
    I got a test certificate from the Verisign.
    Now I want to know, how to sign my applet with that certificate?
    Thanks,
    Siva E.

    Hi!
    You have to create a keystore wich contains the certificate. I think you call keystore -import "verisign.cert"Try the command, and it will tell you what it needs.
    To do the acutal signing of an applet (jar-file), you write somehting like this:
    jarsigner  -keystore "NameOfKeystore" -keypass "PasswordToPrivKey"  -storepass "PasswordToStore" "YourJarFile.jar" "CertAlias"The cert alias is an alias you created when importing the certificate. Hope it Helps!
    Henrik

  • How to sign an applet?

    i want to know how to sign an applet and what's root certs?

    Check this URL ..it might help you
    http://developer.java.sun.com/developer/qow/archive/99/index.html

  • How to sign in Applet?

    Hello,
    How to sign in the Applet? I have try many way to do this but still not successfull.
    I need a webpage that really have the step by step instructions. thanks a lot. ( sorry for saying that, because I really tired to follow those instruction that not complete or confusing )
    What is the certificate? where can I get this? Is it keystore = certificate?
    Do I need to connect to the Internet when I signing up my Applet?
    Why sign in Applet?
    Thanks.

    see if helps,
    http://forum.java.sun.com/thread.jsp?forum=54&thread=103843

  • How to develop signed applet

    Hello Friends
    I am working on chat application using applet.
    But simple applet throw exception for different database server than application server.
    So how can solve this problem ?
    Is Signed Applet a solution ?
    If yes how to develop signed applet ?

    Hello Friends
    I am working on chat application using applet.
    But simple applet throw exception for different
    database server than application server.
    So how can solve this problem ?Best by not letting your applet access the database, and letting the application server do that instead.
    Is Signed Applet a solution ?Yes.
    If yes how to develop signed applet ?http://www.google.com/search?hl=en&q=how+to+sign+an+applet

  • Creating signed Java applet for Netscape 4x

    I have created a signed jar with SuperUser privileges under Netscape.
    public void init() {
    try {
    if( Class.forName("netscape.security.PrivilegeManager") != null ) {
    netscape.security.PrivilegeManager.enablePrivilege("SuperUser");
    } catch( ClassNotFoundException cnfe ) {
    cnfe.printStackTrace();
    With this I am getting following error without any dailog prompting to grant permission.
    netscape.security.ForbiddenTargetException: User didn't grant the SuperUser privilege.
    Please help.
    Thanks
    Satish

    Then it's likely Netscape 4.x doesn't recognize the jar as being signed. How did you sign the jar?
    Why didn't you ask this in the more appropriate Signed Applets forum?

  • Dont ask why! How do I call an applet that is in a jar file that is...

    Can someone tell me how I would call an applet that is inside of a jar file that is inside of a parent jar file?
    example call to an Applet
    <APPLET CODE="TimeApplet" ARCHIVE="time.jar" />what I want to do is something like
    <APPLET CODE="TimeApplet" ARCHIVE="parent.time.jar" />
    where parent is the top jar and time is the inner jar.any help or links to tutorials/articles would be most appreciated.
    if you ask why I wont answer.

    we are doing a signed applet and we only want the user to have to sign 1 time
    and we have lots of applets to display so we dont want to have them sign for
    each item.Sorry but that doesn't make much sense, niether does putting a jar file in a jar file.
    Do you want the "do you trust" question only one time? If so than you only have
    to sign all the jar files with the same key.
    You can load a jar file from your applet but it seems that these jar files will run
    in sanbox security no matter how you sign it:
    http://forum.java.sun.com/thread.jspa?messageID=3582952
    Asking why does make sense, I coud be asking how to climb a building without
    telling my objective is to get on the 10th floor.
    You would tell me how to climb the building an I'd probably do it and find out
    later I could just as well have taken the elivator.

  • How to use sockets in applets?

    hi,
    i wrote the following applet:
    http://spidey.bei.t-online.de/rest/java/jtv/jTV.html
    its a little applet which asks tvtoday.de for the movies which are running on the channels/time and day you specified and puts them into the table
    as a normal java application everything works fine
    but as an applet i always get an exception that im not allow to open sockets to tvtoday.de
    how comes? and is there a way to fix that?
    thx

    Applets are only allowed to create sockets back to the host that they originally came from. This is a security measure - otherwise, a trojan horse applet could be downloaded through a firewall, then open connections and do malicious things to hosts that were supposed to be protected by the firewall.
    I am not sure if there is a way the solve this. Perhaps you could sign your applet and let java pop up a "Let this applet open sockets elsewhere?" window (similar to what java web start can do), but I personally don't know of such a system.

  • How to connect DB with applet

    hi, all
    I am use Mysql as my DB, but when I my program as window application, it is work, but when I run it as Applet, it won't work, can any one tell me how to access the data from DB to Applet?
    public class AppletApp extends JApplet {
    public void init() {
         DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
         try
               Class.forName("org.gjt.mm.mysql.Driver");
                catch(Exception e)
                     System.out.println(e.toString());
                  Connection cn;
                  Statement st;
                  ResultSet rs ;
              try
                     cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/cti", "root", "123");
                    st  =cn.createStatement();
                    rs = st.executeQuery("select name from parent");
              while (rs.next())
                   //System.out.println(rs.getString("name"));
                   DefaultMutableTreeNode NewNode = new DefaultMutableTreeNode(rs.getString("name"));
                   root.add(NewNode);                              
              rs.close();
              st.close();
              cn.close();
                }catch(SQLException se)
              System.out.println(se.toString());
         /*DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("node1");
         root.add(node1);
         node1.add(new DefaultMutableTreeNode("sub1_1"));
         node1.add(new DefaultMutableTreeNode("sub1_2"));
         setSize(400, 400);*/
         getContentPane().add(new JTree(root));     
    public static void main(String arg[]) {
         JFrame myFrame = new JFrame();
         Container contentPane = myFrame.getContentPane();
         contentPane.setLayout(new GridLayout(1,2));
         AppletApp app = new AppletApp();
         contentPane.add(app, BorderLayout.CENTER);
         app.init();
         app.start();
         myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);               
         myFrame.setSize (600,600);
         myFrame.setVisible(true);
    }

    I had signed the applet and there is a .jar file, but when I type
    AppletViewer tree.html
    there are still an sercuity error come out, so thing else I need to do?
    am I need to modifty the html file? right now my html file resource code are look like this:
    <html>
    <applet code = x.class heigh = 300 width = 300>
    </applet>
    </html>

  • What are the steps to sign an applet

    I've been searching and reading for weeks now and just recently I though I had it... I put my Uploader tool online, and the "grant yes/no" came up!! I was excited, and then the applet showed up. This was the farthest i'd gotten thus far, and then... it didn't pop up the JFileChoser. It failed yet again.
    I've searched all over the internet for a way to sign your own applet for free. It doesn't need to be trusted, so long as the applet works by just granting permision.
    If you know the steps to signing an applet, then please post them here. Make them easy to follow, with little on the details of how it works.
    And don't stop at just signing the applet.. keep going until the signed applet is uploaded onto a test server. That, I think, is where a lot of people get confused.
    Nobody has yet done this that i've seen (writen a tutorial) and i've been searching fo weeks!
    Greatly appreciated by myself, and thousands to come.

    I have a signed jar file and a html file on my desktop. I'm loading this jar file localy for testing, and the "grant permision [y/n]" pops up.
    The button also pops up. however the JFileChooser does not.
    The jar has been self-signed, and verified using jarsigner -verify Uploader.jar.
    my end pupose is to allow Multi File Uploading on my site.
    I just want my users to accept my applet, and allow my applet to have read permissions enabled.
    I'm not sure if i need a policy file, and if so, where to put that? in the jar? in the same directory? or do I tell the Html file to link to where the policy file is.
    I don't want my users to have to do anything but accept my applet.
    below is my java code for the uploader.. I thought maybe I need to request permission there too.
    And below that is the html file located on the desktop that loads my applet... incase i need to put code in that too.. like a link to a policy file?
    JavaCode..
    /* This Applet will allow the user to upload multiple files at a time
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.io.File;
    import java.util.jar.*;
    import javax.swing.JFileChooser;
    import javax.swing.SwingUtilities;
    public class Uploader extends Applet implements ActionListener
         Button addFiles;
         Color bgColor;
         public void init()
              //this gets parameters from HTML to set the bgColor
              int r = Integer.parseInt(getParameter("r"), 16);
              int g = Integer.parseInt(getParameter("g"), 16);
              int b = Integer.parseInt(getParameter("b"), 16);
              //set bgColor
              bgColor = new Color(r,g,b);
              //change Background color to bgColor
              setBackground(bgColor);
            setLayout(new FlowLayout());
            addFiles = new Button("Add Files");
            //check if user wants to add files..
            addFiles.addActionListener(this);
            add(addFiles);
         public void actionPerformed(ActionEvent e) {
              //If the upload button was checked.. upload files..
              if (e.getSource() == addFiles){
                   SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                          JFileChooser fileChooser
                                 = new JFileChooser(".");
                          fileChooser.setMultiSelectionEnabled(true);
                          int status = fileChooser.showOpenDialog(null);
                          if (status == JFileChooser.APPROVE_OPTION) {
                                 File selectedFiles[] =
                                      fileChooser.getSelectedFiles();
                             for (int i=0,
                                  n=selectedFiles.length; i<n; i++) {
                                       System.out.println("Selected: "
                                       + selectedFiles.getParent()
              + " --- "
              + selectedFiles[i].getName());
    HTML
    <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
    <html><head>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
       <meta name="GENERATOR" content="Mozilla/4.51 [nl] (Win98; I) [Netscape]">
       <meta name="Author" content="Bavo Bruylandt (RealApplets.com)">
       <meta name="Description" content="Upload Multiple files at once.">
       <meta name="KeyWords" content="Java applet that uploads multiple files at once"><title>Upload-Multi - Applet</title></head>
    <body>
         <center>
              <applet code="Uploader.class" archive="Uploader.jar" height="30" width="100">
                     <param name="r" value="de">
                     <param name="g" value="ad">
                     <param name="b" value="00">
              </applet>
         </center>
    </body></html>

  • I singed into CC on my home computer, now I cant sign in at work? How can I sign in at work?

    I singed into CC on my home computer, now I cant sign in at work? How can I sign in at work? Isn't there an option to sign out of all other devices?

    If the IT dept. at your former employer knows what they're doing, they have already had access to everything on your work computer. As to transferring your data to your home computer, read here:
    https://discussions.apple.com/docs/DOC-3141

Maybe you are looking for