FileDocCategorySizeDatePackage
SSLHelloApplet.javaAPI DocExample1641Wed Apr 19 11:20:18 BST 2000None

SSLHelloApplet

public class SSLHelloApplet extends Applet
Copyright (c) 1996, 1997, 1998,1999 Phaos Technology Corp. All rights reserved.

Fields Summary
String
message
Hello
obj
Constructors Summary
Methods Summary
public voidinit()

    
       
	try {

            // Load the client socket factory from the applet host.
            // contact a secure rmi registry.
            Registry registry = java.rmi.registry.LocateRegistry.
                getRegistry(getCodeBase().getHost(), 1099,
                            new SSLClientSocketFactory());
            
	    /* obtain a remote reference to the secure server using
	     * jrmp over SSL.
	     */
            obj = (Hello) registry.lookup("/HelloServer"); 

	    // invoke a secure remote method
            message = obj.sayHello(); 
	} catch (Exception e) {
	    System.out.println("HelloApplet exception: " +
			       e.getMessage());
	    e.printStackTrace();
	}
    
public voidpaint(java.awt.Graphics g)

	g.drawString(message, 25, 50);