3 #include "ace/Get_Opt.h"
6 #include "ace/SString.h"
7 #include "orbsvcs/SecurityC.h"
9 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
10 const char *cert_file
= "cacert.pem";
13 null_cipher_test (CORBA::ORB_ptr orb
,
14 CORBA::Object_ptr obj
)
16 Security::QOP qop
= Security::SecQOPIntegrity
;
17 // Security::EstablishTrust establish_trust = {0,1};
19 CORBA::Any protection
;
23 //trust <<= establish_trust;
25 CORBA::PolicyList
policy_list (2);
26 policy_list
.length (1);
28 orb
->create_policy (Security::SecQOPPolicy
, protection
);
30 // orb->create_policy (Security::SecEstablishTrustPolicy, trust);
32 // Create an object reference that uses plain IIOP (i.e. no
34 CORBA::Object_var object
=
35 obj
->_set_policy_overrides (policy_list
,
39 Foo::_narrow (object
.in ());
41 if (CORBA::is_nil (server
.in ()))
44 "(%P|%t) ERROR: Object reference <%s> is "
48 throw CORBA::INTERNAL ();
53 // This invocation should result in a CORBA::NO_PERMISSION
57 catch (const CORBA::NO_PERMISSION
&)
60 "(%P|%t) Received CORBA::NO_PERMISSION from "
68 parse_args (int argc
, ACE_TCHAR
*argv
[])
70 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
73 while ((c
= get_opts ()) != -1)
77 ior
= get_opts
.opt_arg ();
81 ACE_ERROR_RETURN ((LM_ERROR
,
88 // Indicates successful parsing of the command line
93 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
98 CORBA::ORB_init (argc
, argv
);
100 if (parse_args (argc
, argv
) != 0)
103 CORBA::Object_var object
=
104 orb
->string_to_object (ior
);
106 null_cipher_test (orb
.in (), object
.in ());
110 catch (const CORBA::Exception
& ex
)
112 ex
._tao_print_exception ("Caught exception:");
116 ACE_DEBUG ((LM_DEBUG
,
118 "Secure_Invocation test passed.\n"));