Daplug Java APIs
Clone or download
benamsaap Update DaplugSession.java
According to the product specification, we should add the apdu Le parameter in the "Read binary" raw command. Le used instead of Lc, specifies the number of data that should be returned by the card.
But, in our approch, this is seen always as the Lc parameter. So, to prevent length errors, we add Lc zero-byte as fake data.

Without a SC, I found that the "Read binary" raw command returns a SW 6702 when we use a Le greather then the file size.. However, it works properly over a secure channel. To keep only one behaviour for both cases, I check the requested length value if it exceeds the file size.
Latest commit 081ea1d May 28, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Initial commit Apr 30, 2014
libs Initial commit Apr 30, 2014
src Update DaplugSession.java May 28, 2015
.gitignore Initial commit Apr 30, 2014
LICENSE Initial commit Apr 30, 2014
README.md Update README.md Mar 24, 2015

README.md

Java Daplug API 1.0.4

Java Daplug API is a Java library for communication with Daplug dongles. It maps the Daplug dongle specification in an user friendly format.

Requirements

This package is developped with java 1.6 (should works with new versions) There are some external jar you need to use :

These are already included in the project in daplug-java/libs.

Specific udev rules for Unix OS

You have to add a specific udev rules to allow access daplug USB devices. Create a file /etc/udev/rules.d/10-daplug.rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="1807", MODE="0660", GROUP="daplug"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="1808", MODE="0660", GROUP="daplug"

To restart udev run :

sudo udevadm trigger

Installation

Please import daplug-java/src folder to your preferred IDE (used one is Eclipse). Do not forget to add the external JARs to your buildpath.