Package org.omg.CSIIOP

Examples of org.omg.CSIIOP.AS_ContextSec


    public short getRequires() {
        return (required ? EstablishTrustInClient.value : 0);
    }

    public AS_ContextSec encodeIOR(ORB orb, Codec codec) throws Exception {
        AS_ContextSec result = new AS_ContextSec();

        result.target_supports = EstablishTrustInClient.value;
        result.target_requires = (required ? EstablishTrustInClient.value : 0);
        result.client_authentication_mech = Util.encodeOID(GSSUPMechOID.value);
        result.target_name = Util.encodeGSSExportName(GSSUPMechOID.value, targetName);
View Full Code Here


      TaggedComponent transport_mech = createTransportMech(
         metadata.getTransportConfig(), codec, sslPort, orb
      );
     
      // Create AS Context
      AS_ContextSec asContext = createAuthenticationServiceContext(metadata);
     
      // Create SAS Context
      SAS_ContextSec sasContext = createSecureAttributeServiceContext(metadata);

      // Create target_requires bit field (AssociationOption)
View Full Code Here

    **/
   public static AS_ContextSec createAuthenticationServiceContext(
      IorSecurityConfigMetaData metadata
      )
   {
      AS_ContextSec context = null;
     
      // the content of the context
      int support = 0;
      int require = 0;
      byte[] clientAuthMech = {};
      byte[] targetName = {};
     
      // get the AsContext metadata
      AsContext asMeta = metadata.getAsContext();
     
      // if no AS context metatada exists, or authentication method
      // "none" is specified, we can produce an empty AS context
      if( asMeta == null || asMeta.getAuthMethod().equals(AsContext.AUTH_METHOD_NONE)
         /*|| asMeta.isRequired() == false*/ )
      {
         context = new AS_ContextSec((short) support,
            (short) require,
            clientAuthMech,
            targetName);
      }
      else
      {
         // we do support
         support = EstablishTrustInClient.value;
        
         // required depends on the metadata
         if( asMeta.isRequired() )
            require = EstablishTrustInClient.value;
        
         // we only support GSSUP authentication method
         clientAuthMech = createGSSUPMechOID();
        
         // finally, encode the "realm" name as a CSI.GSS_NT_ExportedName.
         // clientAuthMech should contain the DER encoded GSSUPMechOID
         // at this point.
         String realm = asMeta.getRealm();
         targetName = createGSSExportedName(clientAuthMech, realm.getBytes());
        
         // wrap it up
         context = new AS_ContextSec((short) support,
            (short) require,
            clientAuthMech,
            targetName);
      }

View Full Code Here

        
         // look for the first matching security mech
         for(int i = 0; i < csmList.mechanism_list.length; i++)
         {
            CompoundSecMech securityMech = csmList.mechanism_list[i];
            AS_ContextSec authConfig = securityMech.as_context_mech;

            if( (EstablishTrustInTarget.value
               & (clientRequires ^ authConfig.target_supports)
               & ~authConfig.target_supports) != 0 )
            {
View Full Code Here

    * @param securityMech - the CompoundSecMech to create the string for
    * @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: ");
View Full Code Here

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

        // a CompoundSecMech contains: target_requires, transport_mech, as_context_mech, sas_context_mech.
        TaggedComponent transport_mech = createTransportMech(metadata.getTransportConfig(), codec, sslPort, orb);

        // 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.
View Full Code Here

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

        AS_ContextSec context;

        // the content of the context.
        int support = 0;
        int require = 0;
        byte[] clientAuthMech = {};
        byte[] targetName = {};

        IORASContextMetaData asMeta = metadata.getAsContext();

        // if no AS context metatada exists, or authentication method "none" is specified, we can produce an empty AS context.
        if (asMeta == null || asMeta.getAuthMethod().equals(IORASContextMetaData.AUTH_METHOD_NONE)) {
            context = new AS_ContextSec((short) support, (short) require, clientAuthMech, targetName);
        } else {
            // we do support.
            support = EstablishTrustInClient.value;

            // required depends on the metadata.
            if (asMeta.isRequired()) {
                require = EstablishTrustInClient.value;
            }

            // we only support GSSUP authentication method.
            clientAuthMech = createGSSUPMechOID();

            // finally, encode the "realm" name as a CSI.GSS_NT_ExportedName.
            // clientAuthMech should contain the DER encoded GSSUPMechOID at this point.
            String realm = asMeta.getRealm();
            targetName = createGSSExportedName(clientAuthMech, realm.getBytes());

            context = new AS_ContextSec((short) support, (short) require, clientAuthMech, targetName);
        }

        return context;
    }
View Full Code Here

            csmList = CompoundSecMechListHelper.extract(any);

            // look for the first matching security mech.
            for (int i = 0; i < csmList.mechanism_list.length; i++) {
                CompoundSecMech securityMech = csmList.mechanism_list[i];
                AS_ContextSec authConfig = securityMech.as_context_mech;

                if ((EstablishTrustInTarget.value & (clientRequires ^ authConfig.target_supports)
                        & ~authConfig.target_supports) != 0) {
                    // client requires EstablishTrustInTarget, but target 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);
View Full Code Here

TOP

Related Classes of org.omg.CSIIOP.AS_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.