public static boolean matches ( final char [ ] assertedPassword , final ManagedUser user ) { final char [ ] prehash = createSha512Hash ( assertedPassword ) ; // Todo: remove String when Jbcrypt supports char[] return BCrypt . checkpw ( new String ( prehash ) , user . getPassword ( ) ) ; }
Checks the validity of the asserted password against a ManagedUsers actual hashed password .