1 package demo.ssl; 2 3 import java.io.*; 4 import org.omg.CORBA.*; 5 6 14 15 public class Client 16 { 17 public static void main( String args[] ) 18 { 19 if( args.length != 1 ) 20 { 21 System.out.println( "Usage: java demo.ssl.Client <ior_file>" ); 22 System.exit( 1 ); 23 } 24 25 try 26 { 27 File f = new File( args[ 0 ] ); 28 29 if( ! f.exists() ) 31 { 32 System.out.println("File " + args[0] + 33 " does not exist."); 34 35 System.exit( -1 ); 36 } 37 38 if( f.isDirectory() ) 40 { 41 System.out.println("File " + args[0] + 42 " is a directory."); 43 44 System.exit( -1 ); 45 } 46 47 ORB orb = ORB.init( args, null ); 49 50 BufferedReader br = 51 new BufferedReader( new FileReader( f )); 52 53 org.omg.CORBA.Object obj = 55 orb.string_to_object( br.readLine() ); 56 57 br.close(); 58 59 SSLDemo demo = SSLDemoHelper.narrow( obj ); 61 62 demo.printCert(); 64 65 System.out.println( "Call to server succeeded" ); 66 } 67 catch( Exception ex ) 68 { 69 ex.printStackTrace(); 70 } 71 } 72 } 73 74 | Popular Tags |