Skip to content

Repository files navigation

JavaCard Connect

Build StatusMaven Central

JavaCard Connect is a framework which provides an implementation of a secure communication protocol in conformance with the Global Platform Card Specification. It allows to establish a secure channel between an off-card entity and a card.

How to use

code

TerminalFactorytf = TerminalFactory.getInstance("PC/SC", null);
CardTerminalsterminals = tf.terminals();
CardTerminalterminal = terminals.list(CardTerminals.State.CARD_PRESENT).get(0);
Cardcard = terminal.connect("*");
CardChannelServiceservice = newCardChannelServiceImpl(KeyProvider.DEFAULT); CardPropertiescardProperties = CardProperties.builder()
.aid(Aid.parse("A000000151000000"))
.keyVersionNumber((byte) 0xFF)
.scpVersion(ScpVersion.SCP_02)
.build();
CardChannelContextcontext = service.createCardChannelContext(cardProperties, newPlainApduChannel(card.getBasicChannel()));
SecureChannelSessionchannelSession = service.createSecureChannelSession(context);
channelSession.openSecureChannel(EnumSet.of(SecurityLevel.C_MAC));
// GET STATUS commandCommandAPDUcommand = newCommandAPDU(0x80, 0xF2, 0x40, 0x00, newbyte[] {0x4F, 0x00});
ResponseAPDUresponse = channelSession.transmit(command);

Download

Download the latest jar via Maven:

<dependency>
<groupId>org.nightcode</groupId>
<artifactId>jc-connect</artifactId>
<version>0.1.10</version>
</dependency>

License


Feedback is welcome. Please don't hesitate to open up a new github issue or simply drop me a line at dmitry@nightcode.org.

About

JavaCard Connect is a framework which provides an implementation of a secure communication protocol in conformance with the Global Platform Card Specification.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages