Expert help needed-grant user permision in Applet

Hi
im writing an Applet that needs to read and write files on user's local machine.
As far as i know i guess i need to grant users permissions. I would like to do it in the easiest way for him(so he wouldnt need to change his policy file manualy, but clic on 'ok')
First of all, is it the only way to do that?
And above all, how to do that?
Could anybody tell me exactly how do i get my applet signed step by step?
Please, a beginer needs help here, it would be great if anybody could tell me how to do that STEP BY STEP.
I have read several post about it, but none was clear enought for me.
If someone could give a hint or a sample code it would be very appreciated.
thanx a lot :)

see http://java.sun.com/docs/books/tutorial/jar/sign/signing.html
To summarize:
1) Use keytool to generate a key
keytool -genkey -keystore mystore -alias myaliasFollow the instructions given, i.e, fill all the blanks.
2) Use jarsigner to sign your jar
jarsigner -keystore mystore my_jar_file.jar myaliasBut you are really skipping everything which you need to understand.

Similar Messages

  • Help needed to access Oracle from Applet.

    Please help. I have spent days reading info on the web and I simply cannot access to Oracle from an applet to work. Oracle is on a different IP than the Web Server. For my testing I am running the html directly from my local file system.
    Here are the steps I have taken:
    1. Create a key: "%JAVA_HOME%/bin/keytool" -genkey -alias MyAlias -keypass MyKPass -keystore C:\Keys.bin -storepass MySPass
    2. Sign my jar: "%JAVA_HOME%/bin/jarsigner" -keystore C:\Keys.bin -storepass MySPass -keypass MyKPass -signedjar myjar-signed.jar myjar.jar MyAlias
    3. Sign Oracle's Jar: "%JAVA_HOME%/bin/jarsigner" -keystore C:\Keys.bin -storepass MySPass -keypass MyKPass -signedjar ojdbc14-signed.jar ojdbc14.jar MyAlias
    4. Applet Tag (at this time I have the two jars in the same folder as the HTML and JS files):
        <applet id="MyApp"
      codebase=""
      archive="myjar-signed.jar,ojdbc14-signed.jar"
      code="com/company/applets/Test.class"
      mayscript
      width="50" height="50">
        </applet>5. Javascript:
      document.observe("dom:loaded", function() {
      alert("Applet: " + $('MyApp').getVersion());
      $('MyApp').getConnection(url, user, pswd);
      alert("Applet: " + $('MyApp').getVersion() + "Got Connection.");
      $('MyApp').testConnection();
      alert("Applet: " + $('MyApp').getVersion() + "Connection Tested.");
    });Execution:
    1. The applet loads, The browser asks if I want to trust it, I say yes.
    2. The '$('MyApp').getVersion()' works.
    3. The '$('MyApp').getConnection(url, user, pswd);' fails. Java Code:
      public void getConnection(String url, String user, String pswd)
          throws Exception {
        try {
          System.out.println("Driver...");
          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
          System.out.println("Connection...");
          _conn = DriverManager.getConnection(url, user, pswd);
          ...The driver registers, but the getConnection fails with a security error.
    After much reading, I used policytool to update the policy file. It added:
    keystore "file:/C:/Keys.bin", "jks";
    grant signedBy "MyAlias" {
      permission java.security.AllPermission;
    };This did not make any difference. Both IE and FF get the same error.
    The JRE being used is 1.6.0_14.
    Any help solving this would be MUCH appreciated.
    Thanks.

    I have simplified the problem, and now it has nothing to do with Oracle. It is a certificate/signing problem.
    Here are the steps I took to set the test up:
    Certificate:
    "%JAVA_HOME%/bin/keytool" -genkey -storepass MyStorePswd -keyalg RSA -alias MyRsa -dname "CN=Company.com, OU=IT, O=Company Inc, L=Atlanta, ST=Georgia, C=US, DC=mailexpress, DC=com" -validity 999
    "%JAVA_HOME%/bin/keytool" -selfcert -storepass MyStorePswd -alias MyRsa -validity 999
    "%JAVA_HOME%/bin/keytool" -exportcert -storepass MyStorePswd -alias MyRsa -rfc -file MyRsa.cer
    "%JAVA_HOME%/bin/keytool" -importcert -keystore "C:\Program Files\Java\jre6\lib\security\cacerts." -storepass changeit -alias MyRsa -file MyRsa.cer
    Jar Signing:
    "%JAVA_HOME%/bin/jarsigner" -storepass MyStorePswd -keypass MyStorePswd -signedjar Text-Project-signed.jar Text-Project.jar MyRsa
    "%JAVA_HOME%/bin/jarsigner" -verify Text-Project-signed.jar
    Result: jar verified.
    HTML:
        <applet id="MyApp"
                codebase="file:/c:/projects/Text-Project/js/Memory"
                archive="Text-Project.jar"           <== unsigned test  OR
                archive="Text-Project-signed.jar"    <== signed   test
                code="com/company/applets/MemTest.class"
                mayscript
                width="50" height="50">
        </applet>
    JavaScript:
    document.observe("dom:loaded", function() {
      alert("Applet: " + $('MyApp').checkSecurity());
    Function in the Applet:
      public String checkSecurity() {
        System.out.println("Security Check...");
        try {
          AccessController.checkPermission(new FilePermission("MemTest.js", "read"));
          AccessController.checkPermission(new FilePermission("MemTest.js", "write"));
          AccessController.checkPermission(new java.net.SocketPermission("192.168.1.121", "resolve"));
        } catch (Exception e) {
          e.printStackTrace();
          return e.getMessage();
        return "Security Checked OK";
      }Results (Internet Explorer):
    1. Unsigned JAR, No policy:
    Result = java.security.AccessControlException: access denied (java.io.FilePermission MemTest.js read)
    (as expected)
    2. Unsigned JAR, Policy = permission java.security.AllPermission:
    Result = Security Checked OK
    (as expected)
    3. Signed JAR, No Policy: Popup states: signature verified; do you want to run the application.
    Result = java.security.AccessControlException: access denied (java.io.FilePermission MemTest.js read)
    (not expected)
    Something is wrong with the certificate or signing process. Any ideas ?
    Thanks.
    Edited by: javadude.101 on Jul 29, 2009 12:29 PM

  • Expert help needed to connect iPhone / iPad using BlueTooth and Wi-Fi

    We need expert help to connect iPhone / iPad using BlueTooth and Wi-Fi. If you have worked with Apple MFi Program [http://developer.apple.com/programs/mfi], or have expertise/experience in this, please contact me. Thanks! Kevin.

    Hi there.
    I connected to my livebox after about three attempts. You have to pair the livebox by pressing either the number one or two that is on the box. When it is in pair mode it stays that way for ten minutes so it gives you chance to try your wep code that is on the bottom of the box a few times. I can't remember which one was successful but i did try the letters in uppercase and lower and one of them seemed to connect.
    Welcome to discussions by the way.
    Hope this helps JB

  • Urgent help needed in two clarifictions of applet code

    Hi,
    I have an applet code where I have two buttons. Now, if button A is clicked it should pass a particular query string while if button B is clicked it should pass another particular query string.
    I would like to confirm
    1) Whether the query string passed is a valid statement(/approach) and
    2) Why there is an error in assigning qryString to qryString1.
    Thanks for any help/advise in advance.
    THE CODE:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    public class ReinApplet1 extends Applet implements ActionListener
    TextField text;
    Button button1;
    Button button2;
    TextArea taResults;
    public void init()
         button1 = new Button("A");
    button1.addActionListener(this);
    add(button1);
    button2 = new Button("B");
    button2.addActionListener(this);
    add(button2);
    taResults = new TextArea(2,30);
    add(taResults);
    // text = new TextField(20);
    // add(text);
    public void actionPerformed(ActionEvent e)
    Object obj = e.getSource();
    if(obj == button1)
    String qryString = "select name from test where letter = A";
    executeQuery();
    if(obj == button2)
    String qryString = "select name from test where letter = B";
    executeQuery();
    public void executeQuery()
    String qryString1 =qryString;
    try
    URL url=new URL("http://localhost:8080/examples/servlet/ReinServlet1");
    String qry=URLEncoder.encode("qry") + "=" +
    URLEncoder.encode(qryString1);
    URLConnection uc=url.openConnection();
    uc.setDoOutput(true);
    uc.setDoInput(true);
    uc.setUseCaches(false);
    uc.setRequestProperty("Content-type",
    "application/x-www-form-urlencoded");
    DataOutputStream dos=new DataOutputStream(uc.getOutputStream());
    dos.writeBytes(qry);
    dos.flush();
    dos.close();
    InputStreamReader in=new InputStreamReader(uc.getInputStream());
    int chr=in.read();
    while(chr != -1)
    taResults.append(String.valueOf((char) chr));
    chr = in.read();
    in.close();
    // br.close();
    catch(MalformedURLException e)
    taResults.setText(e.toString());
    catch(IOException e)
    taResults.setText(e.toString());

    String qryString = "select name from test where letter = A";
    ...this is a local variable ...local to your actionperformed method. The reason the assignment String qryString1 =qryString; doesn't work is because you have no scope to your actionperformed local variables from your executeQuery method. Either make qryString a class variable bty defining it outside any method ...ot, alternatively, pass the string into the executeQuery method.
    if(obj == button1)
      String qryString = "select name from test where letter = A";
      executeQuery(qryString);
    public void executeQuery(String query)
      String qryString1 = query;
    ...As for the sql statement, if you are going to refine the query through the letter column, you will need to pull it into the query when you select...
    ...such as: select name,letter from test where letter = B

  • Help needed - moved user accounts

    I did an upgrade install on my Dual G5 today, but Leopard doesn't know where my users' files are located. I have a very fast (but smaller) HDD for the OS, and moved my user files to a larger HDD. The links were not carried over in the upgrade/install.
    I believe it was a post from Kappy that helped me in moving my user folders initially. Can anyone help me with the needed command line entries needed so that Leopard knows to look to the other HDD for my users?
    Thanks-Gary

    If you've reached the limit of 5 authorisations you have the option once a year to deauthorise them all in one go and start over. By the way, this has nothing to do with the number of products you've purchased and registered. The reason for this is that you have a limit of 5 computers on which you can play purchased content: About iTunes Music Store Authorisation and Deauthorisation
    If your system crashes or your reinstall your operating system without deauthorising iTunes first, even a single computer can use up your limit of 5 authorisations. See also this article: One computer using multiple iTunes Music Store authorizations

  • Expert help needed with tricky query

    I have a query database with a real simple schema but a tricky requirement: i need to display records with a simple select but then filter the result based on the authority/access level of the user making the query.
    The source data is held in a table with just the following columns:
    SRCTABLE:
    subject_ID
    date
    data_ID
    data_item
    All column types are text strings and the first 3 are a composite key. There are 10s of millions of records in the table.
    The access authorization is held in another table with the following columns:
    ACCTABLE:
    data_ID
    access1
    access2
    accessn
    The ellipsis means there are as many (boolean type) access1...n columns as there are distinct access levels to the source data.
    The table contains one row for each distinct data_ID appearing in the source table. On each row the TRUE values in the access1...n columns indicate authorization to see the data item and the filter should leave that row in the result set.
    The question then is how to write the query statement? It is assumed that the access id (i.e. the relevant column) is known when the query is made.
    Something like
    SELECT data_item FROM SRCTABLE
    WHERE subject_ID="xxx" AND date = "1/1/2000";
    would do it except for the need to filter each row based on the access authorization of the user.
    Any help would be appreciated.

    Thanks everybody for responding.
    APC has a good point about really protecting every single item type separately. Unfortunately this is precisely the case. The security in this case is not oriented to increasing security in a levels oriented way. Rather each kind of item is protected by a need to know type security related to that particular item. Users are classified by their need to know a combination of the item types and those combinations are not in any sense consistent (and there will be new classes over time). This way access control necessarily becomes a matrix of item types vs access classes.
    Fortunately this particular database does not exist yet so i am free to solve the problem in any way that fulfills the requirement. This is just the suggested form. I am not entirely happy with it hence the question on this forum in the first place.
    So, i appreciate it should you have any further suggestions for optimal solution to handle the requirements. Again, those are:
    1. A query that returns the data_items for a given ID and date (this is dead simple)
    2. A filter (preferably in the query) that filters out those data_items the current user (his/her access class is known) is not authorized to see.
    3. The plan calls for a table listing every possible item type with a column for each access class, enumerating the items allowed for that class. Any other solution to this issue would be acceptable provided it is capable to independently validate any single item type against any access class.
    I hope this makes sense.

  • IWeb help needed - new user

    "Publisher" documents have converted to iWeb documents but won't open. I'm a new Mac user so need some help :-)

    What application was used to create the .pub files?  If there's no Mac equivalent that can open and use them just select one of the files, type Command+i to bring up the Info window, go to the Open with menu and select "TextEdit".  Then click on the Apply to all button.  This unlinks iWeb from those .pub files so when you double click on one of them iWeb won't try to open.
    If you have a Mac application that can be used to open and use those .pub files then select it in the Open with: menu.
    There is no Mac application that can open the .pub (Microsoft Publisher) files.  However, this site, eHOW, has a link to a web site that can convert those .pub file to PDF files which you can open on a Mac with Preview (included).  The link is Create PDF from Word & Other Formats.  You can give it a try.
    OT

  • Help Needed - Network user login

    Hi Guys,
    Need help.
    I Have a network of imac's which connect to a leopard server OD master. All my user can log on apart from one machine, where none of the users can log in to.
    I have checked the username and passwords and are all correct, but on this one machine the logon screen just shakes just like when a incorrect password is entered.
    Any ideas

    I'm not sure if this is relevant to your situation (which has probably been long solved), but it might help others reading this thread: I've been experiencing a similar problem with network users not being able to log onto a machine and I learned from this thread (http://discussions.apple.com/thread.jspa?threadID=1788420&tstart=30) that network users must have a home directory defined in WGM, even if you're not using networked home directories. Admittedly, the fact that your users could log in from all but one machine suggests that the problem was more likely on the client machine than the server.

  • Dear experts help needed in creation of report in hr

    Please check the below code.
    There is one Transaction code PA20 from these i need the fields in my report.
    I tried writing the report but the fields are from structure so please help in creating the report.
    I am a beginner so i donno how to find the below fields are coming from which table.
    when i do F1 on the fields in PA20 i found the fields but they are from structure.
    type-POOLS: SLIS.
    TYPES : BEGIN OF TY_P0001,
            PERNR TYPE PERNR_D,      "Personnel Number
            BEGDA TYPE BEGDA,        "Start Date
            BUKRS TYPE BUKRS,        "Company Code
            ENAME TYPE EMNAM,        "Formatted Name of Employee or Applicant
            END OF TY_P0001.
    TYPES : BEGIN OF TY_P0016,
            PERNR TYPE PERNR_D,      "Personnel Number
            PRBZT TYPE PRBZT,        "Probationary Period
            CTTYP TYPE CTTYP,        "Contract Type
            END OF TY_P0016.
    TYPES: BEGIN OF TY_P9210,
             PERNR TYPE PERNR_D,
            ZTICKET_AMT TYPE ZTICKET_AMT,  "Ticket Amount
            END OF TY_P9210.
    TYPES : BEGIN OF TY_OUTPUT,
             PERNR TYPE PERNR_D,      "Personnel Number
             BEGDA TYPE BEGDA,        "Start Date
             BUKRS TYPE BUKRS,        "Company Code
             ENAME TYPE EMNAM,        "Formatted Name of Employee or Applicant
             PRBZT TYPE PRBZT,        "Probationary Period
             CTTYP TYPE CTTYP,        "Contract Type
             ZTICKET_AMT TYPE ZTICKET_AMT,  "Ticket Amount
            END OF TY_OUTPUT.
    DATA:  T_P0001 TYPE TY_P0001 OCCURS 1,
           W_P0001 TYPE TY_P0001,
           T_P0016 TYPE TY_P0016 OCCURS 1,
           W_P0016 TYPE TY_P0016,
           T_P9210 TYPE TY_P9210 OCCURS 1,
           W_P9210 TYPE TY_P9210,
           T_OUTPUT TYPE TY_OUTPUT OCCURS 1,
           W_OUTPUT TYPE TY_OUTPUT.
        START-OF-SELECTION.
            SELECT PERNR
                   BEGDA
                   BUKRS
                   ENAME FROM P0001 INTO TABLE T_P0001
                   WHERE
                    AND  BUKRS IN S_BUKRS
                    AND  BEGDA < '31032007'.
              SELECT PERNR
                     PRBZT
                     CTTYP
                     FROM P0016 INTO TABLE T_P0016
                     FOR ALL ENTRIES IN T_P0001
                     WHERE PERNR = T_P0001-PERNR
              SELECT PERNR
                     ZTICKET_AMT
                     FROM P920 INTO TABLE T_P920
                     FOR ALL ENTRIES IN T_P920
                     WHERE PERNR = T_P0001-PERNR.

    use logical data base PNP.
    tables: pernr.
    infotypes: 0001, 0016, ....
    start-of-selection.
    get pernr.
    here all tables Pxxxx defined as INFOTYPES are filled for the selected PERNR.

  • Expert help needed: why does my apple id show in app store....

    when I never signed into the app store before... and... it's not even my system...
    OK...story...
    On my clients iMac who is running os 10.5.8 and wishes to uprgade to 10.8, I did the following:
    -installed 10.6 from my image of the 10.6 installer disc on my utility firewire hd
    -after upgrade, I ran software update and installed the 10.6.8 combo update
    -after reboot went to app store(1st time it has been used) and attempted to purchase & upgrade the OS to 10.8 and noticed in the Store menu that my apple Id was there???
    um….
    how did it get there??? So what I then did was:
    -have my client enter his apple id & paswd and sign in
    -when he attempted to purchase then download, a warning appeared - (not exact) 'downloads for the acct <myappleid> are waiting to be downloaded, please complete the downloads before…(wish I made a screen shot)
    The only way around this was to sign back into my apple id and allow mountain lion to download and install.
    Anyways…
    I had him sign into the app store on another mac and mountain liion was not in his list of purchases, but that didn't surprise me.
    What is completely a mystery is why my apple id made it's way into his app store when it was never there before, I mean the system was at 10.5. prior...I'm baffeled
    This is the second time this has happened, 1st time it was when bringing a a client of mine from 10.5.8 to 10.7 with the same steps as above….
    Does anyone have a clue??

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    I would guess that your Apple ID is in the pirated version of Snow Leopard 10.6 that you are installing on their computers to allow them to update to Mountain Lion.

  • Urgent help need for user exit

    Hi all,
    i have just did one user exit but in RSA3 field is not coming. in step 1 i modified the extract structure. in step 2 in added field in include program ,saved and activated it. but field is not coming in RSA3. can anyone plese help me what should i do now or what has went wrong.
    in RSA3 update mode is 'F'
    thanks in advance

    hi,
      Have you created a project in CMOD and included your User exit component(RSAP0001) and activated it?.
    check that. otherwise give some more details reg. your problem.
    rgrds,
    v.sen.
    Message was edited by:
            Senthilkumar Viswanathan

  • Swing+IE=problems! *expert help needed*

    dear friends
    i want to know that
    1.> wheather i can use swing components in applets
    2.> should i use Applet or JApplet
    3.> are they supportrd well by all browsers? which versions of IE supports swing components?

    Hi Jitin,
    1. Yes, you can use swing components in applets.
    2. You should JApplet.
    3. They are supported by most of the browsers provided user install Java Plugin.
    Vinod

  • Expert help needed [createProcessor(myDataSource) + codec]

    Dear Expert,
    I have a huge problem with the following command
    Manager.createProcessor(this.dataSource);
    When this.dataSource is created by:
    Manager.createDataSource(MediaLocator);
    I am capable to add a codec during the configuration of the processor. And the codec is working fine.
    However if this.dataSource is my own PushBufferDataSourceWrapper (which contains the original datasource and implements MonitorControl)
    the processor is still created the codec is initialized but NEVER accessed...
    So now I have either a processor with a DataSourceWrapper and I can 'preview' the image that my webcam is capturing OR
    I don't have my preview but my Codec works ...
    I want them both!
    Probebly I am missing something so if some of you has an example where there is a custom made datasource and a working codec all in one processor I would like to have a copy of your code for investigation.
    Or is this an ERROR in JMF? (Threads that doesn't come alive...)
    Thanks in advance
    (and goodnight)
    Peter

    PeterYou probably need to use two "DataSource"s (Manager.createClonableDataSource(ds)) and two processors.
    One processor is then a player (previewer) and the other is the capturing processor. There is an example on the JavaSoft JMF web site of previewing and capturing at the same time.
    Dave

  • Expert help needed!!!!Screw It Some help!!

    I unplugged my ipod nano from the computer to go to bed then i woke up and all the songs were deleted.! I went to go add all them bak and i couldnt!! PLZ HELP ME!!!
    ~T Jones

    If they aren't in the library, you need to go to your iTunes folder and import them again. Those songs may also be in your trash bin.

  • Expert Help needed with Sql Loader !

    Hello Friends...I am using one .dat file that contains several values in a
    particular column and I need to load those values in different tables with
    sqlloader.....For example: in column 3 there are values 0001, 0004, 0007, 9999
    ..> values 0001 and 0004 need to be loaded into table1 and value 0007 is
    loaded into table2 and value 9999 needs to be loaded into table3.
    I can successfully use the when clause to load one value at a time but
    cannot load a range or multiple values during the sqlloader load. I can
    call and run separate .ctl files but less complexity and fewer files would
    be better. Tried everything I know but no luck, can't do loads in same
    .ctl file......Does the when clause have limitations whereby only one value
    at a time can evaluated as True or False ?
    I would like to do a Not or InBetween evaluations if possible on that
    single coulmn and then do the loads in the specific tables.
    Any help would be appreciated as I can see my hair turn grayer by the
    minute..My thanks in advance..

    You're asking sql*load to perform an unnatural act.
    Load in you dat file as-is. Create a pl/sql procedure to do the rest.
    Your batch script calls sql*load, then sql*plus to run the proc.
    Must simpler. sql*load is not a procedural language.

Maybe you are looking for

  • After upgrading to Snow Leopard - multimedia keys not controling itunes

    After I upgraded to SL all the special keys( Brightness control, Volume control etc.) are working perfectly, excpet for the media controls (rewind, play\pause, forward). They used to control itunes in Leopard, but now I'm lost without them. I tried:

  • MSS-Portal link with R/3

    Hi folks, We have a QA environment or the MSS-Portal running, linked to our R/3 QA system. It's working fine. Since we are preparing some tests for an SAP Upgrade phase, we need to link the MSS-Portal to a new R/3 server. The basis guys created a new

  • Jdbc -ms sql server

    I have ms sql server instaled on my comp, and i'm using a system account(and for authentification i have windows only chosen), but cannot connect to it using JDBC. My code is: Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); con = Drive

  • Trying to seperate two ipods itunes  on one pc ?

    My pc crashed. Saved data onto new pc and downloaded itunes software 7. Before the crash we had 2 ipods on the pc accessable with different id's. On the new pc, both sets of music have been merged into one itunes. i want to seperate the itunes back t

  • Deploying Forms in iplanet or other iAS

    Dear OTN, Does any body know if its is possible to deploy Oracle forms applications in an application server different from Oracle 9iAS (i.e., iplanet, etc)? The applications was developed under Oracle Forms 9i. Please, any comments or reference to d