Skip to content

Instantly share code, notes, and snippets.

@tatac1
Last active September 30, 2017 18:48
Show Gist options
  • Save tatac1/8361a80fc8f0aceb532f to your computer and use it in GitHub Desktop.
Save tatac1/8361a80fc8f0aceb532f to your computer and use it in GitHub Desktop.
Smart card tips for Linux and Mac,

Install OpenSC

Mac

https://github.com/OpenSC/OpenSC/wiki/OpenSC-Installer-for-Mac-OS-X

Linux

https://github.com/OpenSC/OpenSC/wiki/Linux-Distributions

#Install Driver

Mac

IDGo500

https://www.pentio.com/pki_product_service/drivers/6665_IDGo500_PKCS11_2.3_MountainLion.zip

*this has some bugs

IDGo800

http://www.qaster.com/q/475714977228406784/gemalto+where+can+I+find+the+IDGo+800+PKCS11+libraries+for+Mac+OSX+Is+there+a+guide+to+running+net+smart+cards+on+Mac

Linux

Debian or Ubuntsu

sudo echo "deb-src http://ppa.launchpad.net/gemaltocrypto/dotnet+2.2.0.12/ubuntu devel main “ >> /etc/apt/sources.list ; apt-get source libgtop11dotnet ; apt-get build-dep libgtop11dotne

Arch, etc...

wget -qO-  http://ppa.launchpad.net/gemaltocrypto/dotnet+2.2.0.12/ubuntu/pool/main/libg/libgtop11dotnet/libgtop11dotnet_2.2.0.12.orig.tar.gz |tar xfz -; cd libgtop11dotnet-2.2.0.12/; /configure ; make -j8

pkcs11 module

Mac

module=libidprimepkcs11.0.dylib

Linux

module=libgtop11dotnet.so.0

gen ssh key

pkcs11-tool --module $module --keypairgen --key-type rsa:2048 --login

change pin

pkcs11-tool --module $module --change-pin --login --pin 0000

verify keys

pkcs11-tool --module $module -O

export keys

ssh-keygen -D $module

Certificate and key management

http://xca.sourceforge.net/

@letsjustfixit
Copy link

Hey,
I've ran into this today and managed to solve it by downloading a source rpm, then using alien to create a source debian package. after installing that i got the source compressed in a tar.gz and two patch files. I've applied the patch files and compiled the module (it needed some deps as well but those were listed two pdf files the docs folder).
there was only once catch with the make: the boost thread package had the -mp ending removed so i needed to create a symlink for that lib :)
after that i could use the commands above.producing this: (redacted)
Using slot 0 with a present token:
Data object 1
label:
application:
app_id:
flags: modifiable
Certificate Object, type = X.509 cert
Public Key Object; RSA 1024 bits
Usage: encrypt, verify, wrap
Private Key Object; RSA
Usage: decrypt, sign, unwrap, derive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment