Package org.omg.CSIIOP

Examples of org.omg.CSIIOP.SAS_ContextSec


    **/
   public static SAS_ContextSec createSecureAttributeServiceContext(
      IorSecurityConfigMetaData metadata
      )
   {
      SAS_ContextSec context = null;
     
      // context contains
      // target_supports, target_requires, privilige_authorities,
      // supported_naming_mechanisms, supported_identity_types
      int support = 0;
      int require = 0;
      ServiceConfiguration[] privilAuth = new ServiceConfiguration[0];
      byte[][] supNamMechs = {};
      int supIdenTypes = 0;     // 0 means ITTAbsent
     
      // the the SasContext metadata
      SasContext sasMeta = metadata.getSasContext();
     
      // if no SAS context metadata, or caller propagation is not
      // supported, we return with a more or less empty sas context
      if( sasMeta == null || !sasMeta.isCallerPropagationSupported() )
      {
         context = new SAS_ContextSec((short) support,
            (short) require,
            privilAuth,
            supNamMechs,
            supIdenTypes);
      }
      else
      {
         support = IdentityAssertion.value;
        
         // supporting GSSUP (username/password) naming mechanism
         byte[] upMech = createGSSUPMechOID();
         supNamMechs = new byte[1][upMech.length];
         System.arraycopy(upMech, 0, supNamMechs[0], 0, upMech.length);
        
         // since we support IdentityAssertion we need to specify
         // supported identity types. CTS says we need them all
         supIdenTypes = ITTAnonymous.value |
            ITTPrincipalName.value |
            ITTX509CertChain.value |
            ITTDistinguishedName.value;
         // wrap it up
         context = new SAS_ContextSec((short) support,
            (short) require,
            privilAuth,
            supNamMechs,
            supIdenTypes);
      }
View Full Code Here


               // target requires EstablishTrustInClient,
               // but client does not support it:
               continue; // skip this securityMech
            }

            SAS_ContextSec identityConfig = securityMech.sas_context_mech;

            if( (IdentityAssertion.value
               & (identityConfig.target_requires ^ clientSupports)
               & ~clientSupports) != 0 )
            {
View Full Code Here

    * @param buffer - the buffer to write to
    */
   public static void toString(CompoundSecMech securityMech, StringBuffer buffer)
   {
      AS_ContextSec asMech = securityMech != null ? securityMech.as_context_mech : null;
      SAS_ContextSec sasMech = securityMech != null ? securityMech.sas_context_mech : null;
      if( securityMech != null )
      {
         buffer.append("CompoundSecMech[");
         buffer.append("target_requires: ");
         buffer.append(securityMech.target_requires);
View Full Code Here

                    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);
View Full Code Here

        // create AS Context.
        AS_ContextSec asContext = createAuthenticationServiceContext(metadata);

        // create SAS Context.
        SAS_ContextSec sasContext = createSecureAttributeServiceContext(metadata);

        // create target_requires bit field (AssociationOption) can't read directly the transport_mech TaggedComponent.
        int target_requires = createTargetRequires(metadata.getTransportConfig()) | asContext.target_requires |
                sasContext.target_requires;
View Full Code Here

     *
     * @param metadata the metadata object that contains the CSIv2 security configuration info.
     * @return the constructed {@code SAS_ContextSec} instance.
     */
    public static SAS_ContextSec createSecureAttributeServiceContext(IORSecurityConfigMetaData metadata) {
        SAS_ContextSec context;

        // context contains target_supports, target_requires, privilige_authorities, supported_naming_mechanisms, supported_identity_types.
        int support = 0;
        int require = 0;
        ServiceConfiguration[] privilAuth = new ServiceConfiguration[0];
        byte[][] supNamMechs = {};
        int supIdenTypes = 0; // 0 means ITTAbsent

        // the the SasContext metadata.
        IORSASContextMetaData sasMeta = metadata.getSasContext();

        // if no SAS context metadata, or caller propagation is not supported, we return with a more or less empty sas context.
        if (sasMeta == null || sasMeta.getCallerPropagation().equals(IORSASContextMetaData.CALLER_PROPAGATION_NONE)) {
            context = new SAS_ContextSec((short) support, (short) require, privilAuth, supNamMechs, supIdenTypes);
        } else {
            support = IdentityAssertion.value;

            // supporting GSSUP (username/password) naming mechanism.
            byte[] upMech = createGSSUPMechOID();
            supNamMechs = new byte[1][upMech.length];
            System.arraycopy(upMech, 0, supNamMechs[0], 0, upMech.length);

            // since we support IdentityAssertion we need to specify supported identity types. CTS says we need them all
            supIdenTypes = ITTAnonymous.value | ITTPrincipalName.value | ITTX509CertChain.value | ITTDistinguishedName.value;
            context = new SAS_ContextSec((short) support, (short) require, privilAuth, supNamMechs, supIdenTypes);
        }

        return context;
    }
View Full Code Here

                        & ~clientSupports) != 0) {
                    // target requires EstablishTrustInClient, but client does not support it: skip this securityMech.
                    continue;
                }

                SAS_ContextSec identityConfig = securityMech.sas_context_mech;

                if ((IdentityAssertion.value & (identityConfig.target_requires ^ clientSupports)
                        & ~clientSupports) != 0) {
                    // target requires IdentityAssertion, but client does not support it: skip this securityMech
                    continue;
View Full Code Here

     * @param securityMech the {@code CompoundSecMech} to create the string for.
     * @param builder      the buffer to write to.
     */
    public static void toString(CompoundSecMech securityMech, StringBuilder builder) {
        AS_ContextSec asMech = securityMech != null ? securityMech.as_context_mech : null;
        SAS_ContextSec sasMech = securityMech != null ? securityMech.sas_context_mech : null;
        if (securityMech != null) {
            builder.append("CompoundSecMech[");
            builder.append("target_requires: ");
            builder.append(securityMech.target_requires);
            if (asMech != null) {
View Full Code Here

/*     */
/* 221 */     TaggedComponent transport_mech = createTransportMech(metadata.getTransportConfig(), codec, sslPort, orb);
/*     */
/* 226 */     AS_ContextSec asContext = createAuthenticationServiceContext(metadata);
/*     */
/* 229 */     SAS_ContextSec sasContext = createSecureAttributeServiceContext(metadata);
/*     */
/* 233 */     int target_requires = createTargetRequires(metadata.getTransportConfig()) | asContext.target_requires | sasContext.target_requires;
/*     */
/* 239 */     CompoundSecMech csm = new CompoundSecMech((short)target_requires, transport_mech, asContext, sasContext);
/*     */
View Full Code Here

/* 246 */     return csmList;
/*     */   }
/*     */
/*     */   public static SAS_ContextSec createSecureAttributeServiceContext(IorSecurityConfigMetaData metadata)
/*     */   {
/* 257 */     SAS_ContextSec context = null;
/*     */
/* 262 */     int support = 0;
/* 263 */     int require = 0;
/* 264 */     ServiceConfiguration[] privilAuth = new ServiceConfiguration[0];
/* 265 */     byte[][] supNamMechs = new byte[0][];
/* 266 */     int supIdenTypes = 0;
/*     */
/* 269 */     IorSecurityConfigMetaData.SasContext sasMeta = metadata.getSasContext();
/*     */
/* 273 */     if ((sasMeta == null) || (!sasMeta.isCallerPropagationSupported()))
/*     */     {
/* 275 */       context = new SAS_ContextSec((short)support, (short)require, privilAuth, supNamMechs, supIdenTypes);
/*     */     }
/*     */     else
/*     */     {
/* 283 */       support = 1024;
/*     */
/* 286 */       byte[] upMech = createGSSUPMechOID();
/* 287 */       supNamMechs = new byte[1][upMech.length];
/* 288 */       System.arraycopy(upMech, 0, supNamMechs[0], 0, upMech.length);
/*     */
/* 292 */       supIdenTypes = 15;
/*     */
/* 297 */       context = new SAS_ContextSec((short)support, (short)require, privilAuth, supNamMechs, supIdenTypes);
/*     */     }
/*     */
/* 304 */     return context;
/*     */   }
View Full Code Here

TOP

Related Classes of org.omg.CSIIOP.SAS_ContextSec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.