/** * <p> * Create a {@code TransportAddress[]} with a single {@code TransportAddress}. * </p> * * @param host a {@code String} representing the address host. * @param port an {@code int} representing the address port. * @return the constructed {@code TransportAddress} array. */ public static TransportAddress[] createTransportAddress(String host, int port) { // idl type is unsigned sort, so we need this trick short short_port = (port > 32767) ? (short) (port - 65536) : (short) port; TransportAddress ta = new TransportAddress(host, short_port); TransportAddress[] taList = new TransportAddress[1]; taList[0] = ta; return taList; }
private TLS_SEC_TRANS extractTlsSecTrans(IOR ior, CompoundSecMech mech) { TaggedComponent comp = mech.transport_mech; if (comp.tag != TAG_TLS_SEC_TRANS.value) { return null; } ORB orb = ior.getORB(); CDRInputStream in = doPrivileged(new PrivilegedAction<CDRInputStream>() { @Override public CDRInputStream run() { return new EncapsInputStream(orb, comp.component_data, comp.component_data.length); } }); in.consumeEndian(); return TLS_SEC_TRANSHelper.read(in); }
context = new SAS_ContextSec((short) support, (short) require, privilAuth, supNamMechs, supIdenTypes); } else { support = IdentityAssertion.value; context = new SAS_ContextSec((short) support, (short) require, privilAuth, supNamMechs, supIdenTypes);
CompoundSecMechList csmList = new CompoundSecMechList(false, mechList); CompoundSecMechListHelper.insert(any, csmList); byte[] b = codec.encode_value(any); tc = new TaggedComponent(TAG_CSI_SEC_MECH_LIST.value, b);
public static org.omg.CSIIOP.CompoundSecMechList read (org.omg.CORBA.portable.InputStream istream) { org.omg.CSIIOP.CompoundSecMechList value = new org.omg.CSIIOP.CompoundSecMechList (); value.stateful = istream.read_boolean (); value.mechanism_list = org.omg.CSIIOP.CompoundSecMechanismsHelper.read (istream); return value; }
context = new AS_ContextSec((short) support, (short) require, clientAuthMech, targetName); } else { targetName = createGSSExportedName(clientAuthMech, realm.getBytes(StandardCharsets.UTF_8)); context = new AS_ContextSec((short) support, (short) require, clientAuthMech, targetName);
private CompoundSecMechList readCompoundSecMechList(IOR ior) { Iterator iter = ior.getProfile().getTaggedProfileTemplate().iteratorById(TAG_CSI_SEC_MECH_LIST.value); if (!iter.hasNext()) { return null; } ORB orb = ior.getORB(); TaggedComponent compList = ((com.sun.corba.se.spi.ior.TaggedComponent) iter.next()).getIOPComponent(orb); CDRInputStream in = doPrivileged(new PrivilegedAction<CDRInputStream>() { @Override public CDRInputStream run() { return new EncapsInputStream(orb, compList.component_data, compList.component_data.length); } }); in.consumeEndian(); return CompoundSecMechListHelper.read(in); }
/** * <p> * Create a {@code org.omg.CSIIOP.CompoundSecMechanisms} which is a sequence of {@code CompoundSecMech}. Here we only * support one security mechanism. * </p> * * @param metadata the metadata object that contains the CSIv2 security configuration info. * @param codec the {@code Codec} used to encode the CSIv2 security component. * @param sslPort an {@code int} representing the SSL port. * @param orb a reference to the running {@code ORB}. * @return the constructed {@code CompoundSecMech} array. */ public static CompoundSecMech[] createCompoundSecMechanisms(IORSecurityConfigMetaData metadata, Codec codec, 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. 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; CompoundSecMech csm = new CompoundSecMech((short) target_requires, transport_mech, asContext, sasContext); csmList[0] = csm; return csmList; }
TLS_SEC_TRANS tst = new TLS_SEC_TRANS((short) support, (short) require, taList); TLS_SEC_TRANSHelper.insert(any, tst); byte[] b = codec.encode_value(any); tc = new TaggedComponent(TAG_TLS_SEC_TRANS.value, b);
public static org.omg.CSIIOP.ServiceConfiguration read (org.omg.CORBA.portable.InputStream istream) { org.omg.CSIIOP.ServiceConfiguration value = new org.omg.CSIIOP.ServiceConfiguration (); value.syntax = istream.read_ulong (); value.name = org.omg.CSIIOP.ServiceSpecificNameHelper.read (istream); return value; }
public org.omg.CORBA.TypeCode _type () { return CompoundSecMechanismsHelper.type (); } public void _read (final org.omg.CORBA.portable.InputStream in)
public void _read (final org.omg.CORBA.portable.InputStream in) { value = CompoundSecMechanismsHelper.read (in); } public void _write (final org.omg.CORBA.portable.OutputStream out)
public void _read(final org.omg.CORBA.portable.InputStream _in) { value = org.omg.CSIIOP.AS_ContextSecHelper.read(_in); } public void _write(final org.omg.CORBA.portable.OutputStream _out)
public org.omg.CORBA.TypeCode _type () { return org.omg.CSIIOP.TransportAddressHelper.type (); } public void _read(final org.omg.CORBA.portable.InputStream _in)
public void _write(final org.omg.CORBA.portable.OutputStream _out) { org.omg.CSIIOP.TransportAddressHelper.write(_out, value); } }
public void _write (final org.omg.CORBA.portable.OutputStream out) { ServiceSpecificNameHelper.write (out,value); } }
public org.omg.CORBA.TypeCode _type () { return org.omg.CSIIOP.AS_ContextSecHelper.type (); } public void _read(final org.omg.CORBA.portable.InputStream _in)
public void _read(final org.omg.CORBA.portable.InputStream _in) { value = org.omg.CSIIOP.CompoundSecMechHelper.read(_in); } public void _write(final org.omg.CORBA.portable.OutputStream _out)
public void _write(final org.omg.CORBA.portable.OutputStream _out) { org.omg.CSIIOP.CompoundSecMechHelper.write(_out, value); } }