Package org.jgroups.auth

Examples of org.jgroups.auth.MD5Token


            properties.clear();

            properties.put("auth_value", "chris");
            properties.put("token_hash", "MD5");

            MD5Token token1 = new MD5Token();
            token1.setValue(properties);

            properties.put("auth_value", "chris");
            properties.put("token_hash", "MD5");

            MD5Token token2 = new MD5Token();
            token2.setValue(properties);

            assertTrue(token1.authenticate(token2, null));
        }catch(Exception failException){
            fail(failException.getMessage());
        }
View Full Code Here


            properties.clear();

            properties.put("auth_value", "chris");
            properties.put("token_hash", "MD5");

            MD5Token token1 = new MD5Token();
            token1.setValue(properties);

            properties.put("auth_value", "chrismills");
            properties.put("token_hash", "MD5");

            MD5Token token2 = new MD5Token();
            token2.setValue(properties);

            assertTrue(!token1.authenticate(token2, null));
        }catch(Exception failException){
            fail(failException.getMessage());
        }
View Full Code Here

            properties.clear();

            properties.put("auth_value", "chris");
            properties.put("token_hash", "SHA");

            MD5Token token1 = new MD5Token();
            token1.setValue(properties);

            properties.put("auth_value", "chris");
            properties.put("token_hash", "SHA");

            MD5Token token2 = new MD5Token();
            token2.setValue(properties);

            assertTrue(token1.authenticate(token2, null));
        }catch(Exception failException){
            fail(failException.getMessage());
        }
View Full Code Here

            properties.clear();

            properties.put("auth_value", "chris");
            properties.put("token_hash", "SHA");

            MD5Token token1 = new MD5Token();
            token1.setValue(properties);

            properties.put("auth_value", "chrismills");
            properties.put("token_hash", "SHA");

            MD5Token token2 = new MD5Token();
            token2.setValue(properties);

            assertTrue(!token1.authenticate(token2, null));
        }catch(Exception failException){
            fail(failException.getMessage());
        }
View Full Code Here

     * Uses an MD5 hash type
     * <p/>
     * Test fails if an exception is thrown or authentication fails
     */
    public static void testMD5Token() {
        MD5Token token1=new MD5Token();
        token1.setAuthValue("chris");
        token1.setHashType("MD5");

        MD5Token token2=new MD5Token();
        token2.setAuthValue("chris");
        token2.setHashType("MD5");

        assert token1.authenticate(token2, null);
    }
View Full Code Here

     * Uses an MD5 hash type
     * <p/>
     * Test fails if an exception is thrown or authentication passes
     */
    public static void testMD5TokenMismatch() {
        MD5Token token1=new MD5Token();
        token1.setAuthValue("chris");
        token1.setHashType("MD5");

        MD5Token token2=new MD5Token();
        token2.setAuthValue("chrismills");
        token2.setHashType("MD5");

        assert !token1.authenticate(token2, null);
    }
View Full Code Here

     * Uses an SHA hash type
     * <p/>
     * Test fails if an exception is thrown or authentication fails
     */
    public static void testSHAToken() {
        MD5Token token1=new MD5Token();
        token1.setAuthValue("chris");
        token1.setHashType("SHA");

        MD5Token token2=new MD5Token();
        token2.setAuthValue("chris");
        token2.setHashType("SHA");

        assert token1.authenticate(token2, null);
    }
View Full Code Here

     * Uses an SHA hash type
     * <p/>
     * Test fails if an exception is thrown or authentication passes
     */
    public static void testSHATokenMismatch() {
        MD5Token token1=new MD5Token();
        token1.setAuthValue("chris");
        token1.setHashType("SHA");

        MD5Token token2=new MD5Token();
        token2.setAuthValue("chrismills");
        token2.setHashType("SHA");

        assert !token1.authenticate(token2, null);
    }
View Full Code Here

TOP

Related Classes of org.jgroups.auth.MD5Token

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.