Package org.omg.CSIIOP

Examples of org.omg.CSIIOP.AS_ContextSec


/*     */   {
/* 213 */     CompoundSecMech[] csmList = new CompoundSecMech[1];
/*     */
/* 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;
/*     */
View Full Code Here


/* 304 */     return context;
/*     */   }
/*     */
/*     */   public static AS_ContextSec createAuthenticationServiceContext(IorSecurityConfigMetaData metadata)
/*     */   {
/* 315 */     AS_ContextSec context = null;
/*     */
/* 318 */     int support = 0;
/* 319 */     int require = 0;
/* 320 */     byte[] clientAuthMech = new byte[0];
/* 321 */     byte[] targetName = new byte[0];
/*     */
/* 324 */     IorSecurityConfigMetaData.AsContext asMeta = metadata.getAsContext();
/*     */
/* 328 */     if ((asMeta == null) || (asMeta.getAuthMethod().equals("NONE")))
/*     */     {
/* 331 */       context = new AS_ContextSec((short)support, (short)require, clientAuthMech, targetName);
/*     */     }
/*     */     else
/*     */     {
/* 339 */       support = 64;
/*     */
/* 342 */       if (asMeta.isRequired()) {
/* 343 */         require = 64;
/*     */       }
/*     */
/* 346 */       clientAuthMech = createGSSUPMechOID();
/*     */
/* 351 */       String realm = asMeta.getRealm();
/* 352 */       targetName = createGSSExportedName(clientAuthMech, realm.getBytes());
/*     */
/* 355 */       context = new AS_ContextSec((short)support, (short)require, clientAuthMech, targetName);
/*     */     }
/*     */
/* 361 */     return context;
/*     */   }
View Full Code Here

/* 839 */       csmList = CompoundSecMechListHelper.extract(any);
/*     */
/* 842 */       for (int i = 0; i < csmList.mechanism_list.length; i++)
/*     */       {
/* 844 */         CompoundSecMech securityMech = csmList.mechanism_list[i];
/* 845 */         AS_ContextSec authConfig = securityMech.as_context_mech;
/*     */
/* 847 */         if ((0x20 & (clientRequires ^ authConfig.target_supports) & (authConfig.target_supports ^ 0xFFFFFFFF)) != 0)
/*     */         {
/*     */           continue;
/*     */         }
View Full Code Here

/* 895 */     throw new MARSHAL("Unexpected exception: " + e);
/*     */   }
/*     */
/*     */   public static void toString(CompoundSecMech securityMech, StringBuffer buffer)
/*     */   {
/* 905 */     AS_ContextSec asMech = securityMech != null ? securityMech.as_context_mech : null;
/* 906 */     SAS_ContextSec sasMech = securityMech != null ? securityMech.sas_context_mech : null;
/* 907 */     if (securityMech != null)
/*     */     {
/* 909 */       buffer.append("CompoundSecMech[");
/* 910 */       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

        SAS_ContextSec sasContextSec =
            new SAS_ContextSec( NOT_REQUIRED, NOT_REQUIRED, new ServiceConfiguration[0], new byte[0][0], 0 );

        TaggedComponent transportMech = createTlsTransportMech( targetSupports, targetRequires, port );

        AS_ContextSec asContextSec =
            new AS_ContextSec( targetSupports, targetRequires, new byte[0], new byte[0] );
        CompoundSecMech[] compoundSecMech =
            new CompoundSecMech[] { new CompoundSecMech( targetRequires, transportMech, asContextSec, sasContextSec) };

        return new CompoundSecMechList(false, compoundSecMech);
    }
View Full Code Here

    private CompoundSecMechList createCompoundSecMechListWithoutTls( short targetSupports, short targetRequires )
    {
        SAS_ContextSec sasContextSec = new SAS_ContextSec( NOT_REQUIRED, NOT_REQUIRED, new ServiceConfiguration[0], new byte[0][0], 0 );
        TaggedComponent transportMech = new TaggedComponent( TAG_NULL_TAG.value, new byte[0] );
        AS_ContextSec asContextSec = new AS_ContextSec( targetSupports, targetRequires, new byte[0], new byte[0] );

        CompoundSecMech[] compoundSecMech =
            new CompoundSecMech[] { new CompoundSecMech( targetRequires, transportMech, asContextSec, sasContextSec) };

        return new CompoundSecMechList(false, compoundSecMech);
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

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.