public boolean check ( char [ ] plain , char [ ] database , byte [ ] salt ) { checkNotNull ( plain ) ; checkArgument ( plain . length != 0 , "Plain must not be empty." ) ; checkNotNull ( database ) ; checkArgument ( database . length != 0 , "Database must not be empty." ) ; checkNotNull ( salt ) ; checkArgument ( salt . length != 0 , "Salt must not be empty." ) ; char [ ] hashedPlain = this . hash ( plain , salt ) ; return Arrays . equals ( hashedPlain , database ) ; }
Checks if the given plain password matches the given password hash