Package org.apache.shiro.crypto.hash

Examples of org.apache.shiro.crypto.hash.Sha256Hash.toHex()


            conn = ds.getConnection();
            sql = conn.createStatement();
            sql.executeUpdate("create table users (username varchar(20), password varchar(20))");
            Sha256Hash sha256Hash = salted ? new Sha256Hash(plainTextPassword, salt) :
                new Sha256Hash(plainTextPassword);
            String password = sha256Hash.toHex();
            sql.executeUpdate("insert into users values ('" + username + "', '" + password + "')");
        } catch (SQLException ex) {
            Assert.fail("Exception creating test database");
        } finally {
            JdbcUtils.closeStatement(sql);
View Full Code Here


            conn = ds.getConnection();
            sql = conn.createStatement();
            sql.executeUpdate(
                    "create table users (username varchar(20), password varchar(20), password_salt varchar(20))");
            Sha256Hash sha256Hash = new Sha256Hash(plainTextPassword, salt);
            String password = sha256Hash.toHex();
            sql.executeUpdate("insert into users values ('" + username + "', '" + password + "', '" + salt + "')");
        } catch (SQLException ex) {
            Assert.fail("Exception creating test database");
        } finally {
            JdbcUtils.closeStatement(sql);
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.