Module/container setup

Introduction

This document will describe how you can set up your desired module or generic module for using the functionalities that each module have. This ofcourse requires you to succesfully initialized the Trust1Connector via initialize or authenticated client and have a valid reader to contact

Initialize your module

When the user has selected his desired reader to use we can continue to initialize the module to use. This requires at least the readerID to properly initialize.

Some modules like the LuxID module require you to also add a additional pin and pinType for example, this will also need to be provided in the module initialization.

To initialize a module we first need the client as described in the introduction, here's a quick happy flow of how to retrieve a T1CClient

T1CSdk.T1CClient.initialize(config).then(res => {
    client = res;
}, err => {
    console.error(error)
});

When we have the T1CClient we can use this to choose our module. We can also use the generic interface if we want.

the reader_id is the identifier which can be retrieved from the readers functionality

Base module initialization

Below is an example of how to iniailize the Belgian EID module. This is a specific module that has all the functionalities for the Belgian EID card. You can see we use the client to fetch an instance of the beid module which we can further use to execute any functionality exposed on the beid module.

const beid = client.beid(reader_id);

now we can use this to for example fetch all the available token data;

beid.allData(filters).then(...).catch(...)

Generic

Generic Token

Ofcourse we can also use the generic interface which has all the functions exposed that you can use for all the modules.

This will require you to always provide the module when you call any of its functions. Because it still needs to know which commands it needs to send to the card/token.

// pin and pin_type are needed for luxid
const generic = client.generic(reader_id, pin, pin_type)

When we now want to execute a getAllData for beid we would call it like this;

generic.allData('beid', filters).then(...).catch(...)

Generic is split up in 2 different generic modules. This is because the payment modules differ to much from the regular tokens.

Generic Payment

To initialise a generic payment module its very similar to the token version but the available functions will differ.

const generic = client.paymentGeneric(reader_id)

When we now want to execute a readData for emv we would call it like this;

generic.readData('emv').then(...).catch(...)

Interfaces

Below you can find an overview of the generic interfaces. This shows what functions are available on both. If you want more information about a specific token/module you need to go to their respecitve pages which will explain more in detail what you can do with them.

Generic Token interface

export interface AbstractEidGeneric {
  allData(module: string, filters?: string[] | Options, callback?: (error: T1CLibException, data: TokenAllDataResponse) => void): Promise<TokenAllDataResponse>;
  allCerts(module: string, parseCerts?: boolean,  filters?: string[] | Options, callback?: (error: T1CLibException, data: TokenAllCertsResponse) => void): Promise<TokenAllCertsResponse>;
  biometric(module: string, callback?: (error: T1CLibException, data: TokenBiometricDataResponse) => void): Promise<TokenBiometricDataResponse>;
  tokenData(module: string, callback?: (error: T1CLibException, data: TokenInfoResponse) => void): Promise<TokenInfoResponse>;
  address(module: string, callback?: (error: T1CLibException, data: TokenAddressResponse) => void): Promise<TokenAddressResponse>;
  picture(module: string, callback?: (error: T1CLibException, data: TokenPictureResponse) => void): Promise<TokenPictureResponse>;
  rootCertificate(module: string, parseCerts?: boolean,  callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
  intermediateCertificates(module: string, parseCerts?: boolean,  callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
  authenticationCertificate(module: string, parseCerts?: boolean,  callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
  nonRepudiationCertificate(module: string, parseCerts?: boolean,  callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
  encryptionCertificate(module: string, parseCerts?: boolean,  callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
  issuerCertificate(module: string, parseCerts?: boolean,  callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;

  allCertsExtended(module: string, parseCerts?: boolean, filters?: string[] | Options, callback?: (error: T1CLibException, data: TokenAllCertsExtendedResponse) => void): Promise<TokenAllCertsExtendedResponse>;
  rootCertificateExtended(module: string, parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateExtendedResponse) => void): Promise<TokenCertificateExtendedResponse>;
  intermediateCertificatesExtended(module: string, parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateExtendedResponse) => void): Promise<TokenCertificateExtendedResponse>;
  authenticationCertificateExtended(module: string, parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateExtendedResponse) => void): Promise<TokenCertificateExtendedResponse>;
  nonRepudiationCertificateExtended(module: string, parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateExtendedResponse) => void): Promise<TokenCertificateExtendedResponse>;
  encryptionCertificateExtended(module: string, parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateExtendedResponse) => void): Promise<TokenCertificateExtendedResponse>;
  issuerCertificateExtended(module: string, parseCerts?: boolean,  callback?: (error: T1CLibException, data: TokenCertificateExtendedResponse) => void): Promise<TokenCertificateExtendedResponse>;

  verifyPin(module: string, body: TokenVerifyPinData, callback?: (error: T1CLibException, data: TokenVerifyPinResponse) => void): Promise<TokenVerifyPinResponse>;
  authenticate(module: string, body: TokenAuthenticateOrSignData, callback?: (error: T1CLibException, data: TokenAuthenticateResponse) => void): Promise<TokenAuthenticateResponse>;
  sign(module: string, body: TokenAuthenticateOrSignData, bulk?: boolean, callback?: (error: T1CLibException, data: TokenSignResponse) => void): Promise<TokenSignResponse>;
  allAlgoRefs(module: string, callback?: (error: T1CLibException, data: TokenAlgorithmReferencesResponse) => void): Promise<TokenAlgorithmReferencesResponse>
  resetBulkPin(module: string, callback?: (error: T1CLibException, data: BoolDataResponse) => void): Promise<BoolDataResponse>;
}

Generic Payment interface

export interface AbstractPaymentGeneric {
  readApplicationData(module: string, callback?: (error: T1CLibException, data: PaymentReadApplicationDataResponse) => void): Promise<PaymentReadApplicationDataResponse>;
  readData(module: string, callback?: (error: T1CLibException, data: PaymentReadDataResponse) => void): Promise<PaymentReadDataResponse>;

  allCerts(module: string, aid: string, filters: string[] | Options, callback?: (error: T1CLibException, data: PaymentAllCertsResponse | TokenAllCertsExtendedResponse) => void): Promise<PaymentAllCertsResponse | TokenAllCertsExtendedResponse>;
  issuerPublicCertificate(module: string, aid: string, callback?: (error: T1CLibException, data: PaymentCertificateResponse) => void): Promise<PaymentCertificateResponse>;
  iccPublicCertificate(module: string, aid: string, callback?: (error: T1CLibException, data: PaymentCertificateResponse) => void): Promise<PaymentCertificateResponse>;

  allCertsExtended(module: string, aid: string, filters: string[] | Options, callback?: (error: T1CLibException, data: TokenAllCertsExtendedResponse) => void): Promise<TokenAllCertsExtendedResponse>;
  issuerPublicCertificateExtended(module: string, aid: string, callback?: (error: T1CLibException, data: TokenCertificateExtendedResponse) => void): Promise<TokenCertificateExtendedResponse>;
  iccPublicCertificateExtended(module: string, aid: string, callback?: (error: T1CLibException, data: TokenCertificateExtendedResponse) => void): Promise<TokenCertificateExtendedResponse>;

  verifyPin(module: string, body: PaymentVerifyPinData, callback?: (error: T1CLibException, data: PaymentVerifyPinResponse) => void): Promise<PaymentVerifyPinResponse>;
  resetBulkPin(module: string, callback?: (error: T1CLibException, data: BoolDataResponse) => void): Promise<BoolDataResponse>;
  sign(module: string, body: PaymentSignData, bulk?: boolean, callback?: (error: T1CLibException, data: PaymentSignResponse) => void): Promise<PaymentSignResponse>;
}

Available modules

Below is a list of the available modules;

  • generic

  • paymentGeneric

  • fileex

  • rawprint

  • beid

  • remoteloading

  • emv

  • crelan

  • aventra

  • oberthur

  • idemia

  • luxeid

  • wacom

  • diplad

  • certigna

  • certinomis

  • dnie

  • safenet

  • eherkenning

  • jcop

  • airbus

  • luxtrust

  • camerfirma

  • chambersign

Functions

these are the exposed functions available on the T1CClient to initialize a module

public generic = (reader_id: string, pin?: string, pinType?: PinType): AbstractEidGeneric => {
    return this.moduleFactory.createEidGeneric(reader_id, pin, pinType)
};

public paymentGeneric = (reader_id: string): AbstractPaymentGeneric => {
    return this.moduleFactory.createPaymentGeneric(reader_id)
};

public fileex = (): AbstractFileExchange => {
    return this.moduleFactory.createFileExchange()
};

public rawprint = (): AbstractRawPrint => {
    return this.moduleFactory.createRawPrint()
};

public beid = (reader_id: string): AbstractEidBE => {
    return this.moduleFactory.createEidBE(reader_id)
};

public remoteloading = (reader_id: string): AbstractRemoteLoading => {
    return this.moduleFactory.createRemoteLoading(reader_id)
};

public emv = (reader_id: string): AbstractEmv => {
    return this.moduleFactory.createEmv(reader_id)
};

public crelan = (reader_id: string): AbstractCrelan => {
    return this.moduleFactory.createCrelan(reader_id)
};

// get instance for Aventra
public aventra = (reader_id: string): AbstractAventra => {
    return this.moduleFactory.createAventra(reader_id);
}

// get instance for Oberthur
public oberthur = (reader_id: string): AbstractOberthur73 => {
    return this.moduleFactory.createOberthur(reader_id);
}

// get instance for Oberthur
public idemia = (reader_id: string): AbstractIdemia => {
    return this.moduleFactory.createIdemia(reader_id);
}

public luxeid = (reader_id: string, pin: string, pin_type: PinType): AbstractEidLux => {
    return this.moduleFactory.createEidLUX(reader_id, pin, pin_type);
}

public wacom = (): AbstractWacom => {
    return this.moduleFactory.createWacom();
}

public diplad = (reader_id: string): AbstractEidDiplad => {
    return this.moduleFactory.createEidDiplad(reader_id);
}

public certigna = (reader_id: string): AbstractCertigna => {
    return this.moduleFactory.createCertigna(reader_id);
}

public certinomis = (reader_id: string): AbstractCertinomis => {
    return this.moduleFactory.createCertinomis(reader_id);
}

public dnie = (reader_id: string): AbstractDNIe => {
    return this.moduleFactory.createDNIe(reader_id);
}

public safenet = (reader_id: string): AbstractSafenet => {
    return this.moduleFactory.createSafenet(reader_id);
}

public eherkenning = (reader_id: string): AbstractEherkenning => {
    return this.moduleFactory.createEherkenning(reader_id);
}

public jcop = (reader_id: string): AbstractJcop => {
    return this.moduleFactory.createJcop(reader_id);
}

public airbus = (reader_id: string): AbstractAirbus => {
    return this.moduleFactory.createAirbus(reader_id);
}

public luxtrust = (reader_id: string): AbstractLuxTrust => {
    return this.moduleFactory.createLuxTrust(reader_id);
}

public camerfirma = (reader_id: string): AbstractCamerfirma => {
    return this.moduleFactory.createCamerfirma(reader_id);
}

public chambersign = (reader_id: string): AbstractChambersign => {
    return this.moduleFactory.createChambersign(reader_id);
}

Last updated