JavaCard Connect

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

License

License

GroupId

GroupId

org.nightcode
ArtifactId

ArtifactId

jc-connect
Last Version

Last Version

0.1.8
Release Date

Release Date

Type

Type

jar
Description

Description

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

Project URL

http://github.com/nightcode/jcconnect/
Source Code Management

Source Code Management

http://github.com/nightcode/jcconnect/

Download jc-connect

How to add to project

<!-- https://jarcasting.com/artifacts/org.nightcode/jc-connect/ -->
<dependency>
    <groupId>org.nightcode</groupId>
    <artifactId>jc-connect</artifactId>
    <version>0.1.8</version>
</dependency>
// https://jarcasting.com/artifacts/org.nightcode/jc-connect/
implementation 'org.nightcode:jc-connect:0.1.8'
// https://jarcasting.com/artifacts/org.nightcode/jc-connect/
implementation ("org.nightcode:jc-connect:0.1.8")
'org.nightcode:jc-connect:jar:0.1.8'
<dependency org="org.nightcode" name="jc-connect" rev="0.1.8">
  <artifact name="jc-connect" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.nightcode', module='jc-connect', version='0.1.8')
)
libraryDependencies += "org.nightcode" % "jc-connect" % "0.1.8"
[org.nightcode/jc-connect "0.1.8"]

Dependencies

compile (4)

Group / Artifact Type Version
org.nightcode : bertool jar 0.5
org.bouncycastle : bcprov-jdk15on jar 1.60
org.bouncycastle : bcpkix-jdk15on jar 1.60
com.google.code.findbugs : jsr305 jar 3.0.2

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.easymock : easymock jar 3.6

Project Modules

There are no modules declared in this project.

JavaCard Connect

Build Status Maven 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

  TerminalFactory tf = TerminalFactory.getInstance("PC/SC", null);
  CardTerminals terminals = tf.terminals();
  CardTerminal terminal = terminals.list(CardTerminals.State.CARD_PRESENT).get(0);
  Card card = terminal.connect("*");

  CardChannelService service = new CardChannelServiceImpl(KeyProvider.DEFAULT); 


  CardProperties cardProperties = CardProperties.builder()
      .aid(Aid.parse("A000000151000000"))
      .keyVersionNumber((byte) 0xFF)
      .scpVersion(ScpVersion.SCP_02)
      .build();

  CardChannelContext context = service.createCardChannelContext(cardProperties, new PlainApduChannel(card.getBasicChannel()));
  SecureChannelSession channelSession = service.createSecureChannelSession(context);

  channelSession.openSecureChannel(EnumSet.of(SecurityLevel.C_MAC));

  // GET STATUS command
  CommandAPDU command = new CommandAPDU(0x80, 0xF2, 0x40, 0x00, new byte[] {0x4F, 0x00});
  ResponseAPDU response = channelSession.transmit(command);

Download

Download the latest jar via Maven:

<dependency>
  <groupId>org.nightcode</groupId>
  <artifactId>jc-connect</artifactId>
  <version>0.1.8</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.

Versions

Version
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1