Giter VIP home page Giter VIP logo

smartcard-reader's Introduction

smartcard-reader

A smartcard reader util for Java.

##Purpose Intend to make the creation of CommandAPDU easier and get the ResponseAPDUs from all CardChannels at once.

#Maven Repo

<dependency>
    <groupId>com.github.wnameless</groupId>
    <artifactId>smartcard-reader</artifactId>
    <version>1.1.1</version>
</dependency>

#Quick Start

// It's an example of reading a TWN Health Insurance Card
CommandAPDU cmd1 = APDU.builder().setINS(INS.SELECT_FILE).setP1((byte) 0x04)
                                 .setData("D1580000010000000000000000001100").build(); // Lc field is set automatically by given data length
CommandAPDU cmd2 = APDU.builder().setINS(INS.GET_DATA).setP1((byte) 0x11)
                                 .setData((byte) 0x00, (byte) 0x00).build();          // It's fine to use a byte array to set the data

ListMultimap<CardTerminal, ResponseAPDU> res // Each value stores all ResponseAPDUs of a CardTerminal
    = CardReader.getInstance().read(cmd1, cmd2);

#Feature Automated reader. It performs a task by a time interval if there is any change(card switching, ...) happened on the responses from card terminals.

AutomatedReader reader = new AutomatedReader(cmd1, cmd2);
reader.reading(1000, new CardTask() { // It reads from all CardChannels every second(1000ms)

    public void execute(CardTerminal terminal, List<ResponseAPDU> responses) {
        ...
    }

});

...

reader.stop();

smartcard-reader's People

Contributors

wnameless avatar

Watchers

 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.