def check_password(password)
    return false unless key
    key == self.class.hash_password(password, key.split('|', 2).first)
  end
def check_password(password)
    return false unless key
    key == self.class.hash_password(password, key.split('|', 2).first)
  end
Compares a plain-text password against the password hash in this credential.

 Returns +true+ for a match, +false+ otherwise.