# CardReader

## Solour

Hi,

I got a card reader (SCR331) with a cdrom with drivers.

Actually there is a rpm file for "Linux"; yet, I do not know how to use it.

Unfortunately I could not find anything using "scr331", "cardreader" via emerge -S.

Google did not help either.

If anybody has an idea what to do with the cardreader, pleeease tell me.

Thank you very much for reading this.

Bye

ps:

There is a how-to from 2005 which does not help me completely:

https://forums.gentoo.org/viewtopic-t-392433-highlight-scr331.html

I have installed

```
virtual/libusb-0

sys-apps/pcsc-lite-1.5.3

app-crypt/ccid-1.3.10

dev-libs/opensc-0.11.8
```

I modified my opensc.conf (according to the snipped from the how-to).

I run

```
pcscd -a -f

00000000 commands.c:203:CmdPowerOn Card absent or mute

00000020 ifdhandler.c:1055:IFDHPowerICC() PowerUp failed

00000867 eventhandler.c:443:EHStatusHandlerThread() Error powering up card.
```

An the output occurs when I insert my chip-card.

The log says

```
cat opensc-errors.log

[opensc-tool] ctx.c:346:load_dynamic_driver: Module pcsc: cannot load pcsc library: pcsc: cannot open shared object file: No such file or directory

[opensc-tool] ctx.c:399:load_reader_drivers: Unable to load 'pcsc'.
```

----------

## aricart

I wrote a guide for this here:

http://linux.com/community/blogs/DoD-CAC-Cards-and-Gentoo-Linux.htmlLast edited by aricart on Thu Jul 09, 2009 3:09 pm; edited 1 time in total

----------

## Solour

Very nice.

I installed

```
sys-apps/pcsc-lite  USE="hal -static -usb"

app-crypt/coolkey  USE="-debug"

app-crypt/ccid  USE="-nousb -twinserial"
```

but 

```
pcscd -d -f
```

 gives me (when inserting my card)

```
00000112 winscard_msg_srv.c:317:SHMProcessEventsContext() command CONNECT received by client 7

00000008 winscard.c:303:SCardConnect() Attempting Connect to SCM SCR 331 (42220710222081) 00 00 using protocol: 1

00000007 prothandler.c:107:PHSetProtocol() Protocol T=0 requested but unsupported by the card
```

This seems to be not alright.

Can you help me?

----------

## aricart

Emerge pcsc-tools, which has much better debug functionality. The homepage is here:

http://ludovic.rousseau.free.fr/softwares/pcsc-tools/

The tools included should tell you whether or not everything is alright.

----------

## Solour

By emerging pcsc-tools the above message no longer appears.

pcsc_scan gives me:

```
0: SCM SCR 331 (42220710222081) 00 00

Thu Jul  9 17:34:02 2009

 Reader 0: SCM SCR 331 (42220710222081) 00 00

  Card state: Card inserted,

  ATR: 3C F2 18 00 02 C1 0A 31 FE 58 C8 09 75

ATR: 3C F2 18 00 02 C1 0A 31 FE 58 C8 09 75

+ TS = 3B --> Direct Convention

+ T0 = F2, Y(1): 1111, K: 2 (historical bytes)

  TA(1) = 18 --> Fi=372, Di=12, 31 cycles/ETU

    129032 bits/s at 4 MHz, fMax for Fi = 5 MHz => 161290 bits/s

  TB(1) = 00 --> VPP is not electrically connected

  TC(1) = 02 --> Extra guard time: 2

  TD(1) = C1 --> Y(i+1) = 1100, Protocol T = 1

-----

  TC(2) = 0A --> Work waiting time: 960 x 10 x (Fi/F)

  TD(2) = 31 --> Y(i+1) = 0011, Protocol T = 1

-----

  TA(3) = FE --> IFSC: 254

  TB(3) = 58 --> Block Waiting Integer: 5 - Character Waiting Integer: 8

+ Historical bytes: C8 09

  Category indicator byte: C8 (proprietary format)

+ TCK = 75 (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):

3C F2 18 00 02 C1 0A 31 FE 58 C8 09 75

        Siemens CardOS V4.2B

```

This seems to be ok to me...

Still, in firefox the cryptography modul has status "not present" (even after sccessfull loading).

Is there possibly another check/tool/cmd to see the "valid keys"?

----------

## aricart

I'm not sure about that. My knowledge of smart cards is pretty limited. For instance, it could be that libcoolkeypk11.so is not the right security module for your card. Check the various Coolkey websites for further information.

http://directory.fedoraproject.org/wiki/CoolKey

http://pkg-coolkey.alioth.debian.org/

http://www.redhat.com/mailman/listinfo/coolkey-devel

----------

