EMV
Introduction
This container supports functionality for EMV "chip and PIN" bank cards, including:
- VISA, MasterCard, Amex, CB and UK Post Office Account contact cards
- PayWave (VISA) and PayPass (MasterCard) contactless cards
Get EMV container object
For more information on how to configure the T1C-JLIB client library see Client Configuration. Initialize a T1cClient:
LibConfig conf = new LibConfig();
conf.setEnvironment(Environment.DEV);
conf.setDsUri(DS_URI);
conf.setOcvUri(OCV_URI);
conf.setGclClientUri(URI_T1C_GCL);
conf.setApiKey(API_KEY);
conf.setHardwarePinPadForced(false);
conf.setDefaultPollingIntervalInSeconds(5);
conf.setDefaultPollingTimeoutInSeconds(10);
conf.setSessionTimeout(60);
T1cClient t1cClient = new T1cClient(conf);
Obtain the Reader-object
The constructor for the EMV expect as the parameter to be a valid GclReader object. A GclReader can be obtained from the exposed core functionality, for more information see Core Services.
Core services responds with available card-readers, available card in a card-reader, etc.
For example:
In order to get all connected card-readers, with available cards:
List<GclReader> reader = t1cClient.getCore().getReadersWithInsertedCard();
This function call returns a list of the following objects:
com.t1t.t1c.GclReader
Name | Description | Example Value | Type |
---|---|---|---|
id |
The reader ID | "707e7a6e449f2250" | java.lang.String |
name |
The reader name | "VASCO DIGIPASS 870" | java.lang.String |
pinpad |
The presence of a hardware PIN-pad | false | java.lang.Boolean |
card |
The inserted card | see below | com.t1t.t1c.core.GclCard |
com.t1t.t1c.GclCard
Name | Description | Example Value | Type |
---|---|---|---|
atr |
Answer to Reset | "3B9813400AA503010101AD1311" | java.lang.String |
description |
List of descriptions | ["Axa Bank (Belgium) Mastercard Gold / Axa Bank Belgium", "MisterCash & Proton card","VISA Card (emitted by Bank Card Company - Belgium)"] | java.util.List<java.lang.String> |
We notice that a card object is available in the response in the context of a detected reader.
The reader in the example above is VASCO DIGIPASS 870
, has pin-pad capabilities, and there is a card detected with given ATR and some descriptions.
An ATR (Answer To Reset) identifies the type of a smart-card.
The container must be instantiated with the GclReader object containing the EMV card:
EmvContainer container = t1cClient.getEmvContainer(reader);
All methods for emv
will use the selected reader
Reading data
Applications
List the supported applications on the EMV card
List<GclEmvApplication> applications = container.getApplications();
Response:
java.util.List<com.t1t.t1c.containers.smartcards.emv.GclEmvApplication>
Name | Description | Example Value | Type |
---|---|---|---|
aid |
The AID | "A0000000048002" | java.lang.String |
label |
The application label | "SECURE CODE" | java.lang.String |
priority |
The application priority | 0 | java.lang.Integer |
Application data
The application data contains information of the holder of the card, the validity, the primary account number, ...
GclEmvApplicationData applicationData = container.getApplicationData();
Response:
com.t1t.t1c.containers.smartcards.emv.GclEmvApplication
Name | Description | Example Value | Type |
---|---|---|---|
country |
The country | "BE" | java.lang.String |
countryCode |
The country code | "0056" | java.lang.String |
effectiveDate |
The effective date | "091101" | java.lang.String |
expirationDate |
The application label | "141130" | java.lang.String |
language |
The language | "nl" | java.lang.String |
name |
The name | "" | java.lang.String |
pan |
The PAN | "67034200172725017" | java.lang.String |
Issuer Public Key Certificate
On some applications there is an issuer public key certificate present. The aid parameter indicates which application you want to use, this can be fetched using the applications endpoint.
// Application ID can be retrieved with the Applications endpoint
String aid = "A0000000048002";
GclEmvCertificate certificate = container.getIssuerPublicKeyCertificate(aid);
Response:
com.t1t.t1c.containers.smartcards.emv.GclEmvPublicKeyCertificate
Name | Description | Example Value | Type |
---|---|---|---|
data |
The data | "owD7hDFb...cJ0fHTYo=" | java.lang.String |
exponent |
The exponent | "Aw==" | java.lang.String |
remainder |
The remainder | "ZkSGPIZ4v4rEe7JOO4HX3VrAytZZBvMITumBsGTtVvrXszzl" | java.lang.String |
ICC Public Key Certificate
On some applications there is an icc public key certificate present. The aid parameter indicates which application you want to use, this can be fetched using the applications endpoint.
// Application ID can be retrieved with the Applications endpoint
String aid = "A0000000048002";
GclEmvCertificate certificate = container.getIccPublicKeyCertificate(aid)
Response:
com.t1t.t1c.containers.smartcards.emv.GclEmvPublicKeyCertificate
Data Filter
Filter
All data on the smart card can be dumped at once, or using a filter. In order to read all data at once:
GclEmvAllData data = container.getAllData();
Response:
com.t1t.t1c.containers.smartcards.emv.GclEmvAllData
Name | Description | Example Value | Type |
---|---|---|---|
applicationData |
The application data | See above | com.t1t.t1c.containers.smartcards.emv.GclEmvApplicationData |
applications |
The applications | See above | java.util.List<com.t1t.t1c.containers.smartcards.emv.GclEmvApplication> |
The filter can be used to ask a list of custom data containers. Supported values are: applications, application-data
List<String> filter = Arrays.asList("application-data");
// or to get all available filters:
// filter = container.getAllDataFilters();
GclEmvAllData data = container.getAllData(filter);
Verify PIN
Verify PIN without pin-pad
When the native or Java application is responsible for showing the password input, the following request is used to verify a card holder PIN:
Boolean pinVerified = container.verifyPin("1234");
Response:
java.lang.Boolean
Verify PIN with pin-pad
When the pin entry is done on the pin-pad, the following request is used to verify a given PIN:
Boolean pinVerified = container.verifyPin("1234");
Response:
java.lang.Boolean
Verify PIN - retries left
In order to inform a user upon the PIN retries left, the container will throw a com.t1t.t1c.exceptions.VerifyPinException after an unsuccesfull PIN verification, containing ths
Boolean pinVerified = container.verifyPin("1235");
The following exception will be thrown when PIN is wrong:
com.t1t.t1c.exceptions.VerifyPinException
Name | Description | Example Value | Type |
---|---|---|---|
message |
The message | "Wrong pin, 2 tries remaining" | java.lang.String |
retriesLeft |
The amount of retries left | 2 | java.lang.Integer |
Note that, when the user has at least one retry left, entering a correct PIN resets the PIN retry status
.