Installing necessary driver for Omnikey and install OCFPCSC driver for it.
Driver Part
Install PCSC and tools
$ sudo apt install libpcsclite-dev pcscd pcsc-toolsInstall Omnikey Driver
Go to HID Global and download: OMNIKEY 512X, 532X, 1021, 3X21, 6121 PCSC FOR LINUX X86_64
Actually, use Google and search for ifdokrfid_lnx_x64-2.10.0.1 version. That is the most stable one in my years of experience. Last time I tested it, the new ones was not that relible. May be have change.
$ tar xvfz ifdokrfid_lnx_x64-2.10.0.1.tar.gz && cd ifdokrfid_lnx_x64-2.10.0.1$ sudo ./install -d /usr/lib/pcsc/driversAnd PCSCd should detect the reader. If not, go restart PCSCd
$ sudo systemctl restart pcscdOr, to debug PCSCd
$ sudo systemctl stop pcscd$ sudo pcscd -afdPress CTRL+C to terminate it.
To check card:
$ pcsc_scanPC/SC device scannerV 1.4.25 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>Compiled with PC/SC lite version: 1.8.14Using reader plug'n play mechanismScanning present readers...0: OMNIKEY CardMan 5321 00 00
Wed Dec 21 09:28:44 2016Reader 0: OMNIKEY CardMan 5321 00 00 Card state: Card removed,Install Java SDK
$ sudo apt-get install openjdk-8-jdkInstall OCFPCSC
Download OCF library from OpenSCDP site.
$ wget http://www.openscdp.org/ocf/ocf-1.3.1916.zip$ unzip ocf-1.3.1916.zip$ cd ocf/jni/ocfpcsc$ make JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64$ sudo cp libOCFPCSC1.so /usr/lib/libOCFPCSC1.soDone. Now java app can access card.

