Examples of PasswordHasher


Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

                            Property.AUTHENTICATION_BUILTIN_ITERATIONS_DEFAULT,
                            1, Integer.MAX_VALUE);
                }
            }

            return new PasswordHasher( algorithm, salt, iterations );
        }
    }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

         String password
         )
        throws StandardException
    {
        DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
        PasswordHasher hasher = dd.makePasswordHasher( tc.getProperties() );

        if ( hasher == null )
        {
            throw StandardException.newException( SQLState.WEAK_AUTHENTICATION );
        }

        String  hashingScheme = hasher.encodeHashingScheme();
        String  hashedPassword = hasher.hashPasswordIntoString( userName, password );
           
        Timestamp   currentTimestamp = new Timestamp( (new java.util.Date()).getTime() );

        UserDescriptor  userDescriptor = ddg.newUserDescriptor
            ( userName, hashingScheme, hashedPassword.toCharArray(), currentTimestamp );
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

                                                Dictionary props)
            throws StandardException
    {
        if ( password ==  null ) { return null; }

        PasswordHasher  hasher = getDataDictionary().makePasswordHasher( props );

        if ( hasher != null ) { return hasher.hashAndEncode( user, password ); }
        else { return hashPasswordSHA1Scheme(password); }
    }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

                            Property.AUTHENTICATION_BUILTIN_ITERATIONS_DEFAULT,
                            1, Integer.MAX_VALUE);
                }
            }

            return new PasswordHasher( algorithm, salt, iterations );
        }
    }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

            // Before returning, we pretend to evaluate the password.
            // This helps prevent blackhats from discovering legal usernames
            // by measuring how long password evaluation takes. For more context,
            // see the 2012-02-22 comment on DERBY-5539.
            //
            PasswordHasher          hasher = dd.makePasswordHasher( getDatabaseProperties() );
           
            hasher.hashPasswordIntoString( userName, userPassword ).toCharArray();

            return false;
        }
       
        PasswordHasher      hasher = new PasswordHasher( userDescriptor.getHashingScheme() );
        char[]                     candidatePassword = hasher.hashPasswordIntoString( userName, userPassword ).toCharArray();
        char[]                     actualPassword = userDescriptor.getAndZeroPassword();

        try {
            if ( (candidatePassword == null) || (actualPassword == null)) { return false; }
            if ( candidatePassword.length != actualPassword.length ) { return false; }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

         String password
         )
        throws StandardException
    {
        DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
        PasswordHasher hasher = dd.makePasswordHasher( tc.getProperties() );

        if ( hasher == null )
        {
            throw StandardException.newException( SQLState.WEAK_AUTHENTICATION );
        }

        String  hashingScheme = hasher.encodeHashingScheme();
        String  hashedPassword = hasher.hashPasswordIntoString( userName, password );
           
        Timestamp   currentTimestamp = new Timestamp( (new java.util.Date()).getTime() );

        UserDescriptor  userDescriptor = ddg.newUserDescriptor
            ( userName, hashingScheme, hashedPassword.toCharArray(), currentTimestamp );
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

         String password
         )
        throws StandardException
    {
        DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
        PasswordHasher hasher = dd.makePasswordHasher( tc.getProperties() );

        if ( hasher == null )
        {
            throw StandardException.newException( SQLState.WEAK_AUTHENTICATION );
        }

        String  hashingScheme = hasher.encodeHashingScheme();
        String  hashedPassword = hasher.hashPasswordIntoString( userName, password );
           
        Timestamp   currentTimestamp = new Timestamp( (new java.util.Date()).getTime() );

        UserDescriptor  userDescriptor = ddg.newUserDescriptor
            ( userName, hashingScheme, hashedPassword.toCharArray(), currentTimestamp );
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

                            Property.AUTHENTICATION_BUILTIN_ITERATIONS_DEFAULT,
                            1, Integer.MAX_VALUE);
                }
            }

            return new PasswordHasher( algorithm, salt, iterations );
        }
    }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

            // Before returning, we pretend to evaluate the password.
            // This helps prevent blackhats from discovering legal usernames
            // by measuring how long password evaluation takes. For more context,
            // see the 2012-02-22 comment on DERBY-5539.
            //
            PasswordHasher          hasher = dd.makePasswordHasher( getDatabaseProperties() );
           
            hasher.hashPasswordIntoString( userName, userPassword ).toCharArray();

            return false;
        }
       
        PasswordHasher      hasher = new PasswordHasher( userDescriptor.getHashingScheme() );
        char[]                     candidatePassword = hasher.hashPasswordIntoString( userName, userPassword ).toCharArray();
        char[]                     actualPassword = userDescriptor.getAndZeroPassword();

        try {
            if ( (candidatePassword == null) || (actualPassword == null)) { return false; }
            if ( candidatePassword.length != actualPassword.length ) { return false; }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.PasswordHasher

        if (storedPassword.startsWith( PasswordHasher.ID_PATTERN_SHA1_SCHEME )) {
            return hashPasswordSHA1Scheme(password);
        }
        else
        {
            PasswordHasher  hasher = new PasswordHasher( storedPassword );

            return hasher.hashAndEncode( user, password );
        }
    }
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.