Smartcard support by Alexi Volkov <alexi@pravex.kiev.ua> and additional patches for smartcard-support by Jennings Jared <jared.jennings.ctr@eglin.af.mil>