GithubHelp home page GithubHelp logo

leoayt / libpcsc-cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from web-eid/libpcsc-cpp

0.0 0.0 0.0 79 KB

C++ library for accessing smart cards using the PC/SC API

License: MIT License

Shell 0.29% C++ 97.90% CMake 1.81%

libpcsc-cpp's Introduction

libpcsc-cpp

European Regional Development Fund

C++ library for accessing smart cards using the PC/SC API.

Usage

Example how to list available readers, connect to the smart card in first reader and transmit an APDU:

auto readers = listReaders();
auto card = readers[0].connectToCard();
auto command = CommandApdu::fromBytes({0x2, 0x1, 0x3, 0x4});

auto transactionGuard = card->beginTransaction();
auto response = card->transmit(command);

See more examples in tests.

Building

In Ubuntu:

apt install build-essential pkg-config cmake libgtest-dev valgrind libpcsclite-dev
sudo bash -c 'cd /usr/src/googletest && cmake . && cmake --build . --target install'

cd build
cmake .. # optionally with -DCMAKE_BUILD_TYPE=Debug
cmake --build . # optionally with VERBOSE=1

Testing

Build as described above, then, inside the build directory, run:

ctest # or 'valgrind --leak-check=full ctest'

ctest runs tests that use the libscard-mock library to mock PC/SC API calls.

There are also integration tests that use the real operating system PC/SC service, run them inside build directory with:

./libpcsc-cpp-test-integration

Development guidelines

libpcsc-cpp's People

Contributors

mrts avatar metsma avatar counter178 avatar plaes avatar cyb3r4nt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.