Lionel Victor > pcsc-perl-1.0.8 > PCSC

Download:
pcsc-perl-1.0.8.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 1.0.8   Source   Latest Release: pcsc-perl-1.4.13

NAME ^

PCSC - Smarcard reader interface library

SYNOPSIS ^

 my $hContext = new PCSC();
 
 @ReadersList = $hContext->ListReaders ();

 $hContext->SetTimeout($timeout);

 $apdu = PCSC::array_to_ascii(@apdu);

 @apdu = PCSC::ascii_to_array($apdu);

 $hContext = undef;

DESCRIPTION ^

The PCSC module implements the PCSC class. Objects of this class are used to communicate with the PCSClite daemon (see PCSClite for more information).

PCSC represents an abstraction layer to smartcard readers. It provides a communication layer with a wide variety of readers through a standardized API.

A PCSC object can be used to communicate with more than one reader through PCSCCard objects. Please read PCSC::Card(3pm) for extended information on how to talk to a smart card reader.

A PCSC object uses the following propoerty: $pcsc_object->{hContext} the context returned by the pcsc library

CONSTRUCTORS ^

The following methods can be used to construct a PCSC object:

CONSTRUCTION FAILURE ^

PCSC constructors return an undef value when the object can not be created. $PCSC::errno can be used to get more information about the error. (See section "ERROR HANDLING" below for more information)

PCSC METHODS ^

Here is a list of all the methods that can be used with a PCSC object.

ERROR HANDLING ^

All functions from PCSC objects save the return value in a global variable called $PCSC::errno. This variable therefore holds the latest status of PCSC. It is a double-typed magical variable that behaves just like $!. This means that it both holds a numerical value describing the error and the corresponding string. The numerical value may change from a system to another as it depends on the PCSC library... Here is a small example of how to use it:

 $hContext = new PCSC();
 die ("Can't create the pcsc object: $PCSC::errno\n")
     unless (defined $hContext);

In case the last call was successful, $PCSC::errno contains the 'SCARD_S_SUCCESS' status. Here is a list of all possible error codes They are defined as read-only variables with in the PCSC module:

 $PCSC::SCARD_S_SUCCESS
 $PCSC::SCARD_E_CANCELLED
 $PCSC::SCARD_E_CANT_DISPOSE
 $PCSC::SCARD_E_INSUFFICIENT_BUFFER
 $PCSC::SCARD_E_INVALID_ATR
 $PCSC::SCARD_E_INVALID_HANDLE
 $PCSC::SCARD_E_INVALID_PARAMETER
 $PCSC::SCARD_E_INVALID_TARGET
 $PCSC::SCARD_E_INVALID_VALUE
 $PCSC::SCARD_E_NO_MEMORY
 $PCSC::SCARD_E_UNKNOWN_READER
 $PCSC::SCARD_E_TIMEOUT
 $PCSC::SCARD_E_SHARING_VIOLATION
 $PCSC::SCARD_E_NO_SMARTCARD
 $PCSC::SCARD_E_UNKNOWN_CARD
 $PCSC::SCARD_E_PROTO_MISMATCH
 $PCSC::SCARD_E_NOT_READY
 $PCSC::SCARD_E_SYSTEM_CANCELLED
 $PCSC::SCARD_E_NOT_TRANSACTED
 $PCSC::SCARD_E_READER_UNAVAILABLE
 $PCSC::SCARD_E_PCI_TOO_SMALL
 $PCSC::SCARD_E_READER_UNSUPPORTED
 $PCSC::SCARD_E_DUPLICATE_READER
 $PCSC::SCARD_E_CARD_UNSUPPORTED
 $PCSC::SCARD_E_NO_SERVICE
 $PCSC::SCARD_E_SERVICE_STOPPED

 $PCSC::SCARD_W_UNSUPPORTED_CARD
 $PCSC::SCARD_W_UNRESPONSIVE_CARD
 $PCSC::SCARD_W_UNPOWERED_CARD
 $PCSC::SCARD_W_RESET_CARD
 $PCSC::SCARD_W_REMOVED_CARD
 $PCSC::SCARD_W_INSERTED_CARD

PCSClite users will also be able to use the following (PCSClite specific) codes $PCSC::SCARD_E_UNSUPPORTED_FEATURE $PCSC::SCARD_W_INSERTED_CARD $PCSC::SCARD_SCOPE_GLOBAL $PCSC::SCARD_RESET $PCSC::SCARD_INSERTED $PCSC::SCARD_REMOVED

In addition, the wrapper defines $PCSC::SCARD_P_ALREADY_CONNECTED $PCSC::SCARD_P_NOT_CONNECTED

SEE ALSO ^

PCSClite manpage has useful informations about PCSClite. PCSCCard(3pm) manpage gives informations about how to communicate with a reader and the smart card inside.

COPYRIGHT ^

Please see the copyright file included with your distribution

AUTHORS / ACKNOWLEDGEMENT ^

 Lionel VICTOR <lionel.victor@unforgettable.com>
               <lionel.victor@free.fr>
syntax highlighting: