Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check that smart card is working on linux?

I've a PKCS-11 supported smartcard? I just want to check that my the smartcard is working fine or not. How can check it on Ubuntu? Please guide me. what software I can use? how what steps should I follow?

like image 945
sms247 Avatar asked Dec 02 '22 16:12

sms247


1 Answers

It is important to understand that PKCS#11 standard just defines the C language API to access smartcards and other types of cryptographic hardware (or even software). It is usually hardware vendor who provides software library (.dll for windows, .so for unix etc.) that implements PKCS#11 API and is able to access the hardware (smartcard in your case). Your application usually loads PKCS#11 library and uses PKCS#11 API functions it provides.

In most cases it is the best to use PKCS#11 library provided by your smartcard vendor but there are also many independent software vendors such as A.E.T. or Aloaha who provide smartcard middleware (software package that usually contains PKCS#11 library) that can access a bunch of widely used smartcards. You can also take a look at OpenSC project which provides an open source PKCS#11 library that supports many popular smartcards and USB tokens.

Now let's get back to your questions:

Do I have a PKCS-11 supported smartcard?

You have to check whether there exists a library (open source or commercial) that implements PKCS#11 API and supports your smartcard. If you can find such a library then the answer is yes.

How can I check it on Ubuntu?

If you already have PKCS#11 library then you can install "opensc" package which provides command line application called "pkcs11-tool". You can use following command to list readers and cards accessible via your PKCS#11 library:

pkcs11-tool --module your_pkcs11_library.so --list-slots

If you want to use PKCS#11 library provided by OpenSC project then just replace "your_pkcs11_library.so" with "opensc-pkcs11.so".

What software I can use?

PKCS#11 is widely supported standard so this question is hard to answer. I guess you would like to use open source applications with your smartcard because you have mentioned Ubuntu so here is the short list of well known applications that support PKCS#11:

  • Mozilla Firefox - supports digital signature and client authentication
  • Mozilla Thunderbird - supports digital signing of e-mails
  • LibreOffice - supports digital signing of documents
  • TrueCrypt - supports disk encryption
  • OpenVPN - supports client authentication
  • OpenSSH - supports client authentication
like image 55
jariq Avatar answered Dec 15 '22 13:12

jariq