Search in sources :

Example 1 with CompoundSecMechList

use of com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList in project Payara by payara.

the class CSIV2TaggedComponentInfo method createCompoundSecMechListComponent.

private org.omg.IOP.TaggedComponent createCompoundSecMechListComponent(CompoundSecMech[] mechList) {
    CDROutputObject out = (CDROutputObject) orb.create_output_stream();
    out.putEndian();
    boolean stateful = false;
    CompoundSecMechListHelper.write(out, new CompoundSecMechList(stateful, mechList));
    return new org.omg.IOP.TaggedComponent(TAG_CSI_SEC_MECH_LIST.value, out.toByteArray());
}
Also used : CompoundSecMechList(com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList) TaggedComponent(com.sun.corba.ee.spi.ior.TaggedComponent) CDROutputObject(com.sun.corba.ee.impl.encoding.CDROutputObject)

Example 2 with CompoundSecMechList

use of com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList in project Payara by payara.

the class CSIV2TaggedComponentInfo method getSecurityMechanisms.

/**
 * Get the Compound security mechanism list from the given IOR.
 *
 * @param the IOR.
 * @return the array of compound security mechanisms.
 */
public CompoundSecMech[] getSecurityMechanisms(IOR ior) {
    IIOPProfile prof = ior.getProfile();
    IIOPProfileTemplate ptemp = (IIOPProfileTemplate) prof.getTaggedProfileTemplate();
    Iterator<TaggedComponent> itr = ptemp.iteratorById(TAG_CSI_SEC_MECH_LIST.value);
    if (!itr.hasNext()) {
        if (logger.isLoggable(FINE)) {
            logger.log(FINE, "IIOP:TAG_CSI_SEC_MECH_LIST tagged component not found");
        }
        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;
    CDRInputObject in = new EncapsInputStream(orb, b, b.length);
    in.consumeEndian();
    CompoundSecMechList l = CompoundSecMechListHelper.read(in);
    CompoundSecMech[] list = l.mechanism_list;
    return list;
}
Also used : CDRInputObject(com.sun.corba.ee.impl.encoding.CDRInputObject) IIOPProfile(com.sun.corba.ee.spi.ior.iiop.IIOPProfile) CompoundSecMechList(com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList) CompoundSecMech(com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMech) EncapsInputStream(com.sun.corba.ee.impl.encoding.EncapsInputStream) TaggedComponent(com.sun.corba.ee.spi.ior.TaggedComponent) IIOPProfileTemplate(com.sun.corba.ee.spi.ior.iiop.IIOPProfileTemplate)

Aggregations

CompoundSecMechList (com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList)2 TaggedComponent (com.sun.corba.ee.spi.ior.TaggedComponent)2 CDRInputObject (com.sun.corba.ee.impl.encoding.CDRInputObject)1 CDROutputObject (com.sun.corba.ee.impl.encoding.CDROutputObject)1 EncapsInputStream (com.sun.corba.ee.impl.encoding.EncapsInputStream)1 CompoundSecMech (com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMech)1 IIOPProfile (com.sun.corba.ee.spi.ior.iiop.IIOPProfile)1 IIOPProfileTemplate (com.sun.corba.ee.spi.ior.iiop.IIOPProfileTemplate)1