Package org.omg.CORBA

Examples of org.omg.CORBA.Any


        // 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) {
            throw JacORBMessages.MESSAGES.unexpectedException(e);
View Full Code Here


            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) {
                throw JacORBMessages.MESSAGES.unexpectedException(e);
View Full Code Here

     * @param codec     the {@code Codec} used to encode the token.
     * @return a {@code byte[]} representing the encoded token.
     */
    public static byte[] encodeInitialContextToken(InitialContextToken authToken, Codec codec) {
        byte[] out;
        Any any = ORB.init().create_any();
        InitialContextTokenHelper.insert(any, authToken);
        try {
            out = codec.encode_value(any);
        } catch (Exception e) {
            return new byte[0];
View Full Code Here

        byte[] encodedInitialContextToken = new byte[length];

        System.arraycopy(encodedToken, 2 + n + gssUpMechOidArray.length,
                encodedInitialContextToken, 0,
                length);
        Any any;
        try {
            any = codec.decode_value(encodedInitialContextToken, InitialContextTokenHelper.type());
        } catch (Exception e) {
            return null;
        }
View Full Code Here

                                                          short clientRequires) {
        CompoundSecMechList csmList;
        try {
            TaggedComponent tc = ri.get_effective_component(TAG_CSI_SEC_MECH_LIST.value);

            Any any = codec.decode_value(tc.component_data, CompoundSecMechListHelper.type());
            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];
View Full Code Here

        // initialize msgCtx0Accepted.
        msgCtx0Accepted = createMsgCtxAccepted(0);
    }

    private static Any createMsgCtxAccepted(long contextId) {
        Any any = ORB.init().create_any();
        synchronized (msgBodyCtxAccepted) {
            msgBodyCtxAccepted.complete_msg().client_context_id = contextId;
            SASContextBodyHelper.insert(any, msgBodyCtxAccepted);
        }
        return any;
View Full Code Here

        CurrentRequestInfo() {
        }
    }

    private Any createMsgCtxError(long contextId, int majorStatus) {
        Any any = ORB.init().create_any();
        synchronized (msgBodyCtxError) {
            msgBodyCtxError.error_msg().client_context_id = contextId;
            msgBodyCtxError.error_msg().major_status = majorStatus;
            SASContextBodyHelper.insert(any, msgBodyCtxError);
        }
View Full Code Here

        this.codec = codec;

        // build encapsulated GSSUP error token for ContextError messages (the error code within the error token is
        // GSS_UP_S_G_UNSPECIFIED, which says nothing about the cause of the error).
        ErrorToken errorToken = new ErrorToken(GSS_UP_S_G_UNSPECIFIED.value);
        Any any = ORB.init().create_any();
        byte[] encapsulatedErrorToken;

        ErrorTokenHelper.insert(any, errorToken);
        try {
            encapsulatedErrorToken = codec.encode_value(any);
View Full Code Here

        threadLocal.sasReply = null;
        threadLocal.sasReplyIsAccept = false;

        try {
            ServiceContext sc = ri.get_request_service_context(sasContextId);
            Any any = codec.decode_value(sc.context_data, SASContextBodyHelper.type());
            SASContextBody contextBody = SASContextBodyHelper.extract(any);

            if (contextBody != null) {
                if (contextBody.discriminator() == MTMessageInContext.value) {
                    // should not happen, as stateful context requests are always negotiated down to stateless in this implementation.
                    long contextId = contextBody.in_context_msg().client_context_id;
                    threadLocal.sasReply = createMsgCtxError(contextId, 4 /* major status: no context */);
                    throw JacORBMessages.MESSAGES.missingSASContext();
                } else if (contextBody.discriminator() == MTEstablishContext.value) {
                    EstablishContext message = contextBody.establish_msg();
                    threadLocal.contextId = message.client_context_id;
                    threadLocal.sasContextReceived = true;

                    if (message.client_authentication_token != null && message.client_authentication_token.length > 0) {
                        JacORBLogger.ROOT_LOGGER.authTokenReceived();
                        InitialContextToken authToken = CSIv2Util.decodeInitialContextToken(
                                message.client_authentication_token, codec);
                        if (authToken == null) {
                            threadLocal.sasReply = createMsgCtxError(message.client_context_id, 2 /* major status: invalid mechanism */);
                            throw JacORBMessages.MESSAGES.errorDecodingInitContextToken();
                        }
                        threadLocal.incomingUsername = authToken.username;
                        threadLocal.incomingPassword = authToken.password;
                        threadLocal.incomingTargetName = CSIv2Util.decodeGssExportedName(authToken.target_name);
                        if (threadLocal.incomingTargetName == null) {
                            threadLocal.sasReply = createMsgCtxError(message.client_context_id, 2 /* major status: invalid mechanism */);
                            throw JacORBMessages.MESSAGES.errorDecodingTargetInContextToken();
                        }


                        threadLocal.authenticationTokenReceived = true;
                    }
                    if (message.identity_token != null) {
                        JacORBLogger.ROOT_LOGGER.identityTokenReceived();
                        threadLocal.incomingIdentity = message.identity_token;
                        if (message.identity_token.discriminator() == ITTPrincipalName.value) {
                            // Extract the RFC2743-encoded name from CDR encapsulation.
                            Any a = codec.decode_value(message.identity_token.principal_name(),
                                    GSS_NT_ExportedNameHelper.type());
                            byte[] encodedName = GSS_NT_ExportedNameHelper.extract(a);

                            // Decode the principal name.
                            threadLocal.incomingPrincipalName = CSIv2Util.decodeGssExportedName(encodedName);
View Full Code Here

                supported_interfaces,
                abstract_base_valuetypes,
                false,
                baseValue);

        Any any = getORB().create_any();

        ValueDescriptionHelper.insert(any, md);

        return new Description(DefinitionKind.dk_Value, any);
    }
View Full Code Here

TOP

Related Classes of org.omg.CORBA.Any

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.