try
{
if( tc == null )
{
// for now, no transport mechanizms
TaggedComponent transportMech =
new TaggedComponent(TAG_NULL_TAG.value, new byte[0]);
// the AS_ContextSec
byte[] targetName = sasContext.getClientPrincipal().getBytes();
ServiceConfiguration[] serviceConfiguration = null;
if (atlasValues == null)
{
serviceConfiguration = new ServiceConfiguration[0];
}
else
{
if (atlasValues.atlasCache == null)
atlasValues.atlasCache = "";
ATLASLocator atlasLoc = new ATLASLocator();
atlasLoc.the_url(atlasValues.atlasURL);
ATLASProfile profile = new ATLASProfile();
profile.the_cache_id = atlasValues.atlasCache.getBytes();
profile.the_locator = atlasLoc;
byte[] cdrProfile = new byte[0];
org.omg.CORBA.Any any = orb.create_any();
ATLASProfileHelper.insert( any, profile );
cdrProfile = codec.encode(any);
serviceConfiguration = new ServiceConfiguration[1];
serviceConfiguration[0] =
new ServiceConfiguration(SCS_ATLAS.value, cdrProfile);
}
SAS_ContextSec sasContextSec =
new SAS_ContextSec((short)0,
(short)0,
serviceConfiguration,
new byte[0][0],
0);
// create the security mech list
boolean useStateful =
config.getAttributeAsBoolean("jacorb.security.sas.stateful", true);
CompoundSecMech[] compoundSecMech = new CompoundSecMech[1];
Oid oid = new Oid(sasContext.getMechOID());
byte[] clientAuthenticationMech = oid.getDER();
AS_ContextSec asContextSec =
new AS_ContextSec(sasValues.targetSupports,
sasValues.targetRequires,
clientAuthenticationMech,
targetName);
compoundSecMech[0] =
new CompoundSecMech(sasValues.targetRequires,
transportMech,
asContextSec,
sasContextSec);
CompoundSecMechList compoundSecMechList =
new CompoundSecMechList(useStateful, compoundSecMech);
// export to tagged component
CDROutputStream sasDataStream = new CDROutputStream( orb );
sasDataStream.beginEncapsulatedArray();
CompoundSecMechListHelper.write( sasDataStream , compoundSecMechList );
tc = new TaggedComponent( TAG_CSI_SEC_MECH_LIST.value,
sasDataStream.getBufferCopy() );
sasDataStream.close ();
sasDataStream = null;
}