Results 1 to 7 of 7

Thread: SocketPermission in java

  1. #1
    Join Date
    Jan 2010
    Posts
    311

    SocketPermission in java

    Hello,
    I'm going to write an irc-applet. All goes well until a little thing. Somehow it is important from where address or with which the applet was loaded so that it works. But there are more variants at a building should make the rich two.
    what I found out about the topic is as follows,
    1st apparently has web and irc server on the same computer are. could connect the seen but is nonsense, I've been first, the various applets and server also would absolutely impractical.

    2nd there are a java file that specifies what security and java applets are allowed to do and leave program.

    Can you help me with this? Thank you for your help

  2. #2
    Join Date
    May 2008
    Posts
    222

    Re: SocketPermission in java

    Applets have limited rights, as you yourself have already recognized. This also means that they must not only build up to their host to connect. You can work around this, however, in that we signed the applet. A signed applet has all the rights that an application has. I have not done it yet myself, but as you can peek at. Would be possible, such as cgi-script the connection to the foreign server to produce the desired to fetch data and then store them on your own server.

  3. #3
    Join Date
    Dec 2009
    Posts
    204

    Re: SocketPermission in java

    In the JDK / bin you will find two tools: keytool and jarsigner

    1) keytool-genkey create a certificate (which must still be given a name means there alias
    2) with a jar you pack your applet (ie all class files and other resources)
    3) with jarsigner you sign the jar file (under specification of the above names alias for the certificate)

    Thus, the jar file with your self-produced (and self-signed) certificate signed. If you now test your applet in the browser star (if not possible from a local file / / / bla.html start site, but on a web server), the browser detects that the jar file is signed, and shows a dialogue on security. Since the user has is click on Accept, and you may connect your applet to do anything - including to "foreign" servers. Alien in this case means "outside of the codebase.

  4. #4
    Join Date
    Nov 2009
    Posts
    330

    Re: SocketPermission in java

    I think this is mis understood by you

    1) you can create your own with keytool certificates - it costs nothing, but it works anyway
    2) you can buy certificates (versigin etc.)

    Problem with such home certificates: the user is then always "This certificate is not Trusted" instead of "This certificate is Trusted. Most users do not read it anyway, and then won on okay - for private use do you have there so their no disadvantages.

  5. #5
    Join Date
    Dec 2009
    Posts
    292

    Re: SocketPermission in java

    Step one worked. but I have the jar file with a little effortlessly, 1st I am doing an applet, and around the applet in the html code I need to install in my opinion, one. class file and not a point. jar file. Perhaps the assumption or even file with an jar. The program with eclipse. complains when I want to export my project as a jar file, then, of course, because in my applet has no main method available. So how should I generate the jar file?

  6. #6
    Join Date
    Jan 2010
    Posts
    311

    Re: SocketPermission in java

    Code:
    Main-Class the.temp.MainApplet:
    Here you write clean the class name of your main class. Save the two files. Then click on the build.xml file (right click) and choose "Run as> Ant Build". Alternatively, the keyboard shortcut Alt + Shift + X, then Q. Now he produces the Jar file from all classes that Eclipse has already compiled you automatically in the background. In addition, still packed with all the properties files from your folder src.

  7. #7
    Join Date
    Jan 2010
    Posts
    119

    Re: SocketPermission in java

    In <APPLET> day you give a code no class file, but the name of the class. In addition, the Property = applet.jar archive. The browser then loads the jar file and then looks for the specified class. The manifest in this case is probably for this because when you start the application eg with the applet viewer, because there you do not specify a code attribute.

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Setting Of Java to The Point At Manual Java
    By winni in forum Software Development
    Replies: 4
    Last Post: 10-01-2011, 10:05 PM
  3. Java Programming using Adventnet SNMP Java API
    By ROCKING_Suhas in forum Software Development
    Replies: 5
    Last Post: 17-07-2010, 06:52 AM
  4. Link List Example in Java Sample program in Java
    By trickson in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 08:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,711,891.51163 seconds with 16 queries