Examples of TaggedComponent


Examples of com.sun.corba.ee.spi.ior.TaggedComponent

                _logger.log(Level.FINE, msg);
      }
      return null;
  }

  TaggedComponent tcomp = itr.next();
  if(_logger.isLoggable(Level.FINE)){
      _logger.log(Level.FINE,"Component:" + tcomp);
  }

  if (itr.hasNext()) {
      String msg = "More than one TAG_CSI_SEC_MECH_LIST tagged " +
       "component found ";
            _logger.log(Level.SEVERE,"iiop.many_tagged_component");
      throw new RuntimeException(msg);
  }

  org.omg.IOP.TaggedComponent comp = tcomp.getIOPComponent(orb);
  byte[] b = comp.component_data;
  CDRInputStream in = (CDRInputStream) new EncapsInputStream(orb, b, b.length);
  in.consumeEndian();
  CompoundSecMechList l = CompoundSecMechListHelper.read(in);
  CompoundSecMech[] list = l.mechanism_list;
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

            (short) sslPort);
         ORB orb = ORB.init();
         Any any = orb.create_any();
         SSLHelper.insert(any, ssl);
         byte[] componentData = codec.encode_value(any);
         defaultSSLComponent = new TaggedComponent(TAG_SSL_SEC_TRANS.value,
            componentData);
         // Get the default IOR security metadata from the system registry.
         IorSecurityConfigMetaData metadata = (IorSecurityConfigMetaData) Registry.lookup(
             CorbaORBService.IOR_SECURITY_CONFIG);
         defaultCSIComponent = CSIv2Util.createSecurityTaggedComponent(metadata,
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

      if (csiv2Policy != null)
      {
         // if csiv2Policy effective, stuff a copy of the TaggedComponents
         // already created by the CSIv2Policy into the IOR's IIOP profile
         TaggedComponent sslComponent =
            csiv2Policy.getSSLTaggedComponent();
         if (sslComponent != null &&
             CorbaORBService.getSSLComponentsEnabledFlag() == true)
         {
            info.add_ior_component_to_profile(sslComponent,
                                              TAG_INTERNET_IOP.value);
         }
         TaggedComponent csiv2Component =
            csiv2Policy.getSecurityTaggedComponent();
         if (csiv2Component != null)
         {
            info.add_ior_component_to_profile(csiv2Component,
               TAG_INTERNET_IOP.value);
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

           
            any.insert_string(codeBase);

            try {
                byte[] data = codec.encode(any);
                TaggedComponent component = new TaggedComponent(
                        TAG_JAVA_CODEBASE.value, data);

                info.add_ior_component(component);
            } catch (InvalidTypeForEncoding e) {
                logger.warning("Failed to add java codebase to IOR" + e);
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

    public void setRequires(short requires) {
        this.requires = requires;
    }

    public TaggedComponent encodeIOR(ORB orb, Codec codec) {
        TaggedComponent result = new TaggedComponent();

        TLS_SEC_TRANS tst = new TLS_SEC_TRANS();

        tst.target_supports = supports;
        tst.target_requires = requires;
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

     *
     * @param tc the {@code TaggedComponent} to be copied.
     * @return a reference to the created copy.
     */
    public static TaggedComponent createCopy(TaggedComponent tc) {
        TaggedComponent copy = null;

        if (tc != null) {
            byte[] buf = new byte[tc.component_data.length];
            System.arraycopy(tc.component_data, 0, buf, 0, tc.component_data.length);
            copy = new TaggedComponent(tc.tag, buf);
        }
        return copy;
    }
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

        if (metadata == null) {
            log.debugf("createSSLTaggedComponent() called with null metadata");
            return null;
        }

        TaggedComponent tc;
        try {
            int supports = createTargetSupports(metadata.getTransportConfig());
            int requires = createTargetRequires(metadata.getTransportConfig());
            SSL ssl = new SSL((short) supports, (short) requires, (short) sslPort);
            Any any = orb.create_any();
            SSLHelper.insert(any, ssl);
            byte[] componentData = codec.encode_value(any);
            tc = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData);
        } catch (InvalidTypeForEncoding e) {
            log.warn("Caught unexcepted exception while encoding SSL component", e);
            throw new RuntimeException(e);
        }
        return tc;
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

        if (metadata == null) {
            log.debugf("createSecurityTaggedComponent() called with null metadata");
            return null;
        }

        TaggedComponent tc;

        // get the the supported security mechanisms.
        CompoundSecMech[] mechList = createCompoundSecMechanisms(metadata, codec, sslPort, orb);

        // the above is wrapped into a CSIIOP.CompoundSecMechList structure, which is NOT a CompoundSecMech[].
        // we don't support stateful/reusable security contexts (false).
        CompoundSecMechList csmList = new CompoundSecMechList(false, mechList);
        // finally, the CompoundSecMechList must be encoded as a TaggedComponent
        try {
            Any any = orb.create_any();
            CompoundSecMechListHelper.insert(any, csmList);
            byte[] b = codec.encode_value(any);
            tc = new TaggedComponent(TAG_CSI_SEC_MECH_LIST.value, b);
        } catch (InvalidTypeForEncoding e) {
            log.warn("Caught unexcepted exception while encoding CompoundSecMechList", e);
            throw new RuntimeException(e);
        }
        return tc;
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

                                                                int sslPort, ORB orb) {
        // support just 1 security mechanism for now (and ever).
        CompoundSecMech[] csmList = new CompoundSecMech[1];

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

Examples of org.omg.IOP.TaggedComponent

     * @param orb     a reference to the running {@code ORB}.
     * @return the constructed {@code TaggedComponent}.
     */
    public static TaggedComponent createTransportMech(TransportConfig tconfig, Codec codec, int sslPort, ORB orb) {

        TaggedComponent tc;

        // what we support and require as a target.
        int support = 0;
        int require = 0;

        if (tconfig != null) {
            require = createTargetRequires(tconfig);
            support = createTargetSupports(tconfig);
        }

        if (tconfig == null || support == 0 || sslPort < 0) {
            // no support for transport security.
            tc = new TaggedComponent(TAG_NULL_TAG.value, new byte[0]);
        } else {
            // my ip address.
            String host;
            try {
                host = InetAddress.getLocalHost().getHostAddress();
            } catch (java.net.UnknownHostException e) {
                host = "127.0.0.1";
            }

            // this will create only one transport address.
            TransportAddress[] taList = createTransportAddress(host, sslPort);
            TLS_SEC_TRANS tst = new TLS_SEC_TRANS((short) support, (short) require, taList);

            // The tricky part, we must encode TLS_SEC_TRANS into an octet sequence.
            try {
                Any any = orb.create_any();
                TLS_SEC_TRANSHelper.insert(any, tst);
                byte[] b = codec.encode_value(any);
                tc = new TaggedComponent(TAG_TLS_SEC_TRANS.value, b);
            } catch (InvalidTypeForEncoding e) {
                log.warn("Caught unexcepted exception while encoding TLS_SEC_TRANS", e);
                throw new RuntimeException(e);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.