I wrote a script to assist with generating a cert to use with libpam-p11. Here it is https://github.com/jtmoree-github-com/smartcard-tools . working on adding to my ppa.