Examples of InitialContextToken


Examples of org.omg.GSSUP.InitialContextToken

        */
    }

    public static byte[] encode(ORB orb, Codec codec, String username, String password, byte[] target_name)
    {
        InitialContextToken subject = null;
        try
        {
            subject = new InitialContextToken( username.getBytes("UTF-8"),
                                               password.getBytes("UTF-8"),
                                               target_name);
        }
        catch(java.io.UnsupportedEncodingException e)
        {
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

        // Extract client authentication token
        if (support_gssup_authorization
            && establishMsg.identity_token.discriminator() == ITTAbsent.value
            && establishMsg.client_authentication_token.length > 0)
        {
            InitialContextToken gssupToken = decodeGSSUPToken(establishMsg.client_authentication_token);

            String useratrealm = utf8decode(gssupToken.username);

            String name;
            String realm;
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

            }

        } else {

            // Make GSSUP InitialContextToken
            InitialContextToken gssupToken = new InitialContextToken();
            gssupToken.username = utf8encode(scopedUserName);
            gssupToken.target_name = encodeGSSExportedName(realm);
            gssupToken.password = utf8encode(password);

            establishMsg.client_authentication_token = encodeGSSUPToken(gssupToken);
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

            // write the GSS ASN tag
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            baos.write(ASN_TAG_GSS);

            // create and encode a GSSUP initial context token
            InitialContextToken init_token = new InitialContextToken();
            init_token.username = user.getBytes("UTF-8");

            init_token.password = pwd.getBytes("UTF-8");

            init_token.target_name = encodeGSSExportName(GSSUPMechOID.value.substring(4), target);
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

                            int len = token_len - oid_len;
                            byte[] init_tok_arr = new byte[len];
                            bais.read(init_tok_arr, 0, len);
                            Any a = codec.decode_value(init_tok_arr,
                                    InitialContextTokenHelper.type());
                            InitialContextToken token = InitialContextTokenHelper.extract(a);
                            if (token != null) {
                                gssup_tok.username = token.username;
                                gssup_tok.password = token.password;
                                gssup_tok.target_name = decodeGSSExportName(token.target_name).getBytes("UTF-8");
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

    public Subject check(EstablishContext msg) throws SASException {
        Subject result = null;

        try {
            if (msg.client_authentication_token != null && msg.client_authentication_token.length > 0) {
                InitialContextToken token = new InitialContextToken();

                if (!Util.decodeGSSUPToken(Util.getCodec(), msg.client_authentication_token, token))
                    throw new SASException(2);

                if (token.target_name == null) return null;
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

            // write the GSS ASN tag
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            baos.write(ASN_TAG_GSS);

            // create and encode a GSSUP initial context token
            InitialContextToken init_token = new InitialContextToken();
            init_token.username = user.getBytes("UTF-8");

            init_token.password = pwd.getBytes("UTF-8");

            init_token.target_name = encodeGSSExportName(GSSUPMechOID.value.substring(4), target);
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

                            int len = token_len - oid_len;
                            byte[] init_tok_arr = new byte[len];
                            bais.read(init_tok_arr, 0, len);
                            Any a = codec.decode_value(init_tok_arr,
                                    InitialContextTokenHelper.type());
                            InitialContextToken token = InitialContextTokenHelper.extract(a);
                            if (token != null) {
                                gssup_tok.username = token.username;
                                gssup_tok.password = token.password;
                                gssup_tok.target_name = decodeGSSExportName(token.target_name).getBytes("UTF-8");
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

                byte[] username = name.getBytes(StandardCharsets.UTF_8);
                // I don't know why there is not a better way to go from char[] -> byte[].
                byte[] password = serverPassword.getBytes(StandardCharsets.UTF_8);

                // create authentication token
                InitialContextToken authenticationToken = new InitialContextToken(username, password, encodedTargetName);
                // ASN.1-encode it, as defined in RFC 2743.
                encodedAuthenticationToken = CSIv2Util.encodeInitialContextToken(authenticationToken, codec);
            }

            if (identityToken != absentIdentityToken || encodedAuthenticationToken != noAuthenticationToken) {
View Full Code Here

Examples of org.omg.GSSUP.InitialContextToken

                        String tmp = credential.toString();
                        password = tmp.getBytes(StandardCharsets.UTF_8);
                    }

                    // create authentication token.
                    InitialContextToken authenticationToken = new InitialContextToken(username, password,
                            encodedTargetName);
                    // ASN.1-encode it, as defined in RFC 2743.
                    byte[] encodedAuthenticationToken = CSIv2Util.encodeInitialContextToken(authenticationToken,
                            codec);
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.