A library that may be used to work with scdaemon and SmartCards. This may be useful for client software that deals with security keys based on OpenPGP Smart Card standards.
Building with Maven >= 3.9.x is recommended. Java 22 is required in order for the build to finish successful.
mvn clean install
This library requires Java 22.
See demo/README.md
Due to the usage of Java 22 code, the following special setup is required:
- Add the following JVM options to launch configurations of tests in order to be able to run JUnit tests from within the IDE:
-ea --enable-native-access=ALL-UNNAMED -Dnet.bytebuddy.experimental=true --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
try (var scardHandle = JScdLib.constructSCardHandle()) {
scardHandle.listReaders().forEach(System.out::println);
}
try (var assuanHandle = JScdLib.constructAssuanHandle()) {
// SmartCard must be attached in order for this to show output.
assuanHandle.sendCommand("SERIALNO", System.out::println, System.out::println);
}