CardReaderProvider-NFC-Android

The CardReaderProvider-NFC-Android library provides functionality to use the NFC interface on Android devices.

License

License

Categories

Categories

IDE Development Tools
GroupId

GroupId

de.gematik.ti
ArtifactId

ArtifactId

cardreader.provider.nfc
Last Version

Last Version

1.1.2
Release Date

Release Date

Type

Type

aar
Description

Description

CardReaderProvider-NFC-Android
The CardReaderProvider-NFC-Android library provides functionality to use the NFC interface on Android devices.
Project URL

Project URL

https://github.com/gematik/ref-CardReaderProvider-NFC-Android
Project Organization

Project Organization

de.gematik
Source Code Management

Source Code Management

https://github.com/gematik/ref-CardReaderProvider-NFC-Android

Download cardreader.provider.nfc

How to add to project

<!-- https://jarcasting.com/artifacts/de.gematik.ti/cardreader.provider.nfc/ -->
<dependency>
    <groupId>de.gematik.ti</groupId>
    <artifactId>cardreader.provider.nfc</artifactId>
    <version>1.1.2</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/de.gematik.ti/cardreader.provider.nfc/
implementation 'de.gematik.ti:cardreader.provider.nfc:1.1.2'
// https://jarcasting.com/artifacts/de.gematik.ti/cardreader.provider.nfc/
implementation ("de.gematik.ti:cardreader.provider.nfc:1.1.2")
'de.gematik.ti:cardreader.provider.nfc:aar:1.1.2'
<dependency org="de.gematik.ti" name="cardreader.provider.nfc" rev="1.1.2">
  <artifact name="cardreader.provider.nfc" type="aar" />
</dependency>
@Grapes(
@Grab(group='de.gematik.ti', module='cardreader.provider.nfc', version='1.1.2')
)
libraryDependencies += "de.gematik.ti" % "cardreader.provider.nfc" % "1.1.2"
[de.gematik.ti/cardreader.provider.nfc "1.1.2"]

Dependencies

compile (8)

Group / Artifact Type Version
de.gematik.ti : openhealthcard.common jar 1.1.2
de.gematik.ti : utils jar 1.2.1
de.gematik.ti : openhealthcard.events jar 1.2.0
com.google.dagger : dagger jar 2.19
com.madgag.spongycastle : prov jar 1.58.0.0
com.madgag.spongycastle : core jar 1.58.0.0
org.greenrobot : eventbus jar 3.1.1
org.slf4j : slf4j-api jar 1.7.25

Project Modules

There are no modules declared in this project.

NFCCardReaderProvider

Introduction

This part describes the usage of low level CardReaderProvider for NFC CardReader in your application.

API Documentation

Generated API docs are available at https://gematik.github.io/ref-CardReaderProvider-NFC-Android.

License

Licensed under the Apache License, Version 2.0.

Overview

NfcCardReaderProvider

Integration

The NFC CardReaderProvider needs a descriptor behind YOUR.PROVIDER\src\main\resources\META-INF\services with filename de.gematik.ti.cardreader.provider.spi.ICardReaderControllerProvider and the content of the package and class which implements the service provider interface de.gematik.ti.cardreader.provider.usb.nfc.control.NfcCardReaderProvider.

Hardware

The NFC CardReaderProvider supports the integrating of smart card functionality using NFC.

Control

Nfc Control

NfcCardReaderProvider

The NfcCardReaderProvider class needs implementation of the interface 'ICardReaderControllerProvider' to handle listener and provide methods to inform connected listeners about card reader changes.

NfcCardReaderProvider

NfcCardReaderController

The NfcCardReaderController class extends the abstract class 'AbstractCardReaderController' to handle necessary permissions and checking if the application context is set. Returns a list with currently connected Tactivo cardReaders and informs about reader connection and disconnection.

NfcCardReaderController

NfcReceiver

The NfcReceiver class extends the BroadCastReceiver class that receives and handles broadcast intents sent by {@link android.content.Context#sendBroadcast(Intent)}. The actions of the intents that are being handled are changes in the state of the NFC adapter.

NfcReceiver

NfcCardChecker

The NfcCardChecker would automatically started for each connected NfcCardReader to monitor the current card status. This checker send Events on EventBus for each present or absent card. For triggering this changed would use the SmartCardIo methods waitForCardAbsent and waitForCardPresent.

NfcCardChecker

Entities

Entities

NfcCardReader

The NFC Smart Card Reader implements the Interface ICardReader. Works as Adapter to the Android NfcManager and uses the Android ReaderCallback from Android NfcAdapter to detect NFC SmartCards.

NfcCardReader

NfcCard

A Smart Card with which a connection has been established. NfcCard extends the abstract class Card.

NfcCard

NfcCardChannel

A logical channel connection to a Smart Card. It is used to exchange APDUs with a Smart Card the NfcCardReader class. A NfcCardChannel object can be obtained by calling the method nfcCard.getBasicChannel() or NfcCard.openLogicalChannel().

NfcCardChannel

Security

Implements Secure Messaging for encrypting plain Command APDU and decrypting encrypted Response APDU.

NfcSecureMessaging

TagObjects

TagObjects

Getting Started

Build setup

To use CardReaderProvider for NFC CardReader on Android-Device in a project, you need just to include following dependency:

Gradle dependency settings to use CardReaderProvider for NFC CardReader on Android-Device library.

dependencies {
    implementation group: 'de.gematik.ti', name: 'cardreader.provider.nfc', version: '1.1.2'
}

Maven dependency settings to use CardReaderProvider for NFC CardReader on Android-Device library.

<dependencies>
    <dependency>
        <groupId>de.gematik.ti</groupId>
        <artifactId>cardreader.provider.nfc</artifactId>
        <version>1.1.2</version>
    </dependency>
</dependencies>
de.gematik.ti

Gematik

Versions

Version
1.1.2