You probably want to have a look at Restrict_access_settings. Unfortunately, you can't restrict the access to a whole course.
There is an 'ID number' field in user profiles but no way to fill it automatically. If you have access to some developer resource it wouldn't be a particularly difficult thing to write.