Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jacorb.demo.sas;
 
 
This is the server part of the sas demo. It demonstrates how to get access to the certificates that the client sent for mutual authentication. The certificate chain can be accessed via the Security Level 2 interfaces.

Author(s):
Nicolas Noffke
public class GssUpServer extends SASDemoPOA {
    private boolean shutdown;
    private ORB orb;
    public GssUpServer(ORB orb) {
        this. = orb;
    }
    public void printSAS() {
        try {
            org.omg.CORBA.Any anyName = current.get_slot(.....);
            ifanyName.type().kind().value() == .... ) {
                ..println("Null Name");
            } else {
                String name = anyName.extract_string();
                ..println("printSAS for user " + name);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public void shutdown ()
    {
         = true;
    }
    public boolean getShutdown ()
    {
        return ;
    }
    public static void main(String[] argsthrows Exception
    {
        // initialize the ORB and POA.
        ORB orb = ORB.init(argsnull);
        POA rootPOA = (POAorb.resolve_initial_references("RootPOA");
        org.omg.CORBA.Policy [] policies = new org.omg.CORBA.Policy[3];
        policies[0] = rootPOA.create_id_assignment_policy(.);
        policies[1] = rootPOA.create_lifespan_policy(.);
        Any sasAny = orb.create_any();
        SASPolicyValuesHelper.insertsasAnynew SASPolicyValues(..true) );
        policies[2] = orb.create_policy(.sasAny);
        POA securePOA = rootPOA.create_POA("SecurePOA"rootPOA.the_POAManager(), policies);
        rootPOA.the_POAManager().activate();
        // create object and write out IOR
        GssUpServer server = new GssUpServer(orb);
        securePOA.activate_object_with_id("SecureObject".getBytes(), server);
        org.omg.CORBA.Object demo = securePOA.servant_to_reference(server);
        PrintWriter pw = new PrintWriter(new FileWriter(args[0]));
        pw.println(orb.object_to_string(demo));
        pw.flush();
        pw.close();
        while ( args.length == 3 || ! server.getShutdown ())
        {
            Thread.sleep(1000);
        }
        orb.shutdown(true);
    }
New to GrepCode? Check out our FAQ X