*/
public SAS_ContextSec createSASContextSec(
EjbIORConfigurationDescriptor iorDesc)
throws IOException
{
SAS_ContextSec sasContext = null;
// target_supports = 0 means that target supports ITTAbsent
int target_supports = 0;
int target_requires = 0;
ServiceConfiguration[] priv = new ServiceConfiguration[0];
String callerPropagation = null;
byte[][] mechanisms = {};
if(_logger.isLoggable(Level.FINE)){
_logger.log(Level.FINE, "IIOP: Creating SAS_Context");
}
// this shall be non-zero if target_supports is non-zero
int supported_identity_token_type = 0;
if (iorDesc != null) {
callerPropagation = iorDesc.getCallerPropagation();
}
if ((callerPropagation != null)
&& (callerPropagation.equalsIgnoreCase(EjbIORConfigurationDescriptor.NONE))){
sasContext = new SAS_ContextSec((short)target_supports,
(short)target_requires,
priv, mechanisms,
supported_identity_token_type);
return sasContext;
}
target_supports = IdentityAssertion.value;
byte[] upm = GSSUtils.getMechanism(); // Only username_password mechanism
mechanisms = new byte[1][upm.length];
for(int i = 0; i < upm.length; i++) {
mechanisms[0][i] = upm[i];
}
// para 166 of CSIv2 spec says that the bit corresponding to the
// ITTPrincipalName is non-zero if supported_mechanism has atleast
// 1 element. Supported_mechanism has the value of GSSUP OID
if (target_supports != 0){
supported_identity_token_type = SUPPORTED_IDENTITY_TOKEN_TYPES;
}
sasContext = new SAS_ContextSec((short)target_supports,
(short)target_requires,
priv, mechanisms,
supported_identity_token_type);
return sasContext;