arrow-left

Only this pageAll pages
gitbookPowered by GitBook
1 of 31

v3.1.x

Loading...

Loading...

Core

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Trust1Connector SDK integration

Loading...

Token

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Payment

Loading...

Loading...

Loading...

FIle

Loading...

HSM

Loading...

PKCS11

Loading...

Loading...

Introduction

Trust1Connector v3 Release Documentation

hashtag
A Word of Introduction

The Trust1Connector is a technical product that aims to make all hardware tokens, used for authentication and digital signing, interoperable in a web environment. No operating system dependencies to take into account, no browser dependencies, and compatible with smart-card readers, contactless readers and pin-pad readers/terminals.

Our mission is straight forward our focus is to enable secured communication, from a web application, to a desktop device, in the world of person identity, mainly for the following use cases:

  • Read token information (personal info, ICAO, ...)

  • Read certificates, certificate chains or certificate information

  • Verify a known password (PIN, PUK, CAN, ...)

Our mission is to add all token profiles we find in B2C and B2B, government, banking, insurance, health, ...

This library is an SDK meant for fast integration in a web application. We promote although the use of the REST API. After installation of the middleware, from an application perspective, you can consume the functionalities as you do with other microservices. The application will need any REST client, in any language to enable all card communication functionalities.

As the connector exists for more than 5 years, Trust1Team decided to enhance the design, security, functionalities, ... and to incorporate all feedback of existing partners into the Trust1Connector v3.

The library has evolved as a technology product for smart card communication to a framework of secured communication from a browser to any hardware device. In our eco-system we have implemented communication to various printers, signature tablets, biometric devices etc.

During the years, the Trust1Connector has evolved from a product to be installed on standalone dekstops to a product which can be used on shared environments such as Citrix, XenApp, ...

In order to guarantee secured communication, former versions needed a user to have administrator rights during the installation. From this release on, the solution runs completely in user space, sandboxed and hardened. No user data is compromised and thus the solution is GDPR compliant.

hashtag
Characteristics of Trust1Connector

The following list describes the characteristics of the Trust1Connector:

  • Browser independent (no impact upon browser update)

  • No need for browser plugin

  • Based on official communication standards, security standards and regulations

Authenticate using a hash
  • Digitally sign a hash

  • No additional software needed, the middleware includes it's own dependencies
  • Recoverability build-in, preventive checks and tamper-proof

  • Coops with multiple card readers/terminals (contact and contactless)

  • Coops with multiple card types (we call it card application profiles)

  • Extendable and secured framework, we are open to add any card the business needs on our platform

  • Installers for all supported versions of Mac, Windows and Linux

  • Installers for Citrix, XenApp or other shared environments

  • Belgian eID

    hashtag
    Introduction

    The Belgian eID container facilitates communication with card readers with inserted Belgian eID smart card. The T1C-JS client library provides function to communicate with the smart card and facilitates integration into a web or native application. This document describes the functionality provided by the Belgian eID container on the T1C-GCL (Generic Connector Library).

    hashtag
    Interface

    hashtag
    Models

    All model information can be found in the

    hashtag
    Get Belgian eID container object

    Initialise a Trust1Connector client:

    Get the Belgian eID container service:

    Call a function for the Belgian eID container:

    hashtag
    Obtain the Reader-ID

    The constructor for the Belgian eID expect as the parameter to be a valid reader-ID. A reader-ID can be obtained from the exposed core functionality, for more information see 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:

    This function call returns:

    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 Bit4id miniLector, has no pin-pad capabilities, and there is a card detected with given ATR and description "Belgian eID Card". An ATR (Answer To Reset) identifies the type of a smart-card. The reader, has a unique ID, reader_id; this reader_id must be used in order to request functionalities for the Belgian eID card. This must be done upon instantiation of the Belgian eID container:

    All methods for beid will use the selected reader - identified by the reader_id.

    hashtag
    Cardholder Information

    The card holder is the person identified using the Belgian eID card. It's important to note that all data must be validated in your backend. Data validation can be done using the appropriate certificate (public key).

    hashtag
    Biometric data

    Contains all card holder related data, excluding the card holder address and photo. The service can be called:

    An example callback:

    Response:

    hashtag
    Address

    Contains the card holder's address. The service can be called:

    Response:

    hashtag
    Picture

    Contains the card holder's picture stored on the smart card. The service can be called:

    Response:

    hashtag
    Token info

    The token info contains generic information about the card and it's capabilities. This information includes the serial number, file types for object directory files, algorithms implemented on the card, etc.

    Response:

    hashtag
    Certificates

    Exposes all the certificates publicly available on the smart card.

    hashtag
    Root Certificate

    Contains the 'root certificate' stored on the smart card. The root certificate is used to sign the 'citizen CA certificate'. When additional parsing of the certificate is needed you can add a boolean to indicate if you want to parse the certificate or not. The service can be called:

    Response:

    hashtag
    Authentication Certificate

    Contains the 'authentication certificate' stored on the smart card. The 'authentication certificate' contains the public key corresponding to the private RSA authentication key. The 'authentication certificate' is needed for pin validation and authentication. When additional parsing of the certificate is needed you can add a boolean to indicate if you want to parse the certificate or not The service can be called:

    Response:

    hashtag
    Intermediate Certificate (citizen)

    Contains the citizen certificate stored on the smart card. The 'citizen certificate' is used to sign the 'authentication certificate' and the 'non-repudiation certificate'. When additional parsing of the certificate is needed you can add a boolean to indicate if you want to parse the certificate or not The service can be called:

    Response:

    hashtag
    Non-repudiation Certificate

    Contains the 'non-repudiation certificate' stored on the smart card. The 'non-repudiation certificate' contains the public key corresponding the private RSA non-repudiation key. When additional parsing of the certificate is needed you can add a boolean to indicate if you want to parse the certificate or not The service can be called:

    Response:

    hashtag
    Encryption Certificate (RRN)

    Contains the 'encryption certificate' stored on the smart card. The 'encryption certificate' corresponds to the private key used to sign the 'biometric' and 'Address' data. When additional parsing of the certificate is needed you can add a boolean to indicate if you want to parse the certificate or not The service can be called:

    Response:

    hashtag
    Data Filter

    hashtag
    Filter Card Holder Data

    All data on the smart card can be dumped at once, or using a filter. In order to read all data at once:

    Response:

    The filter can be used to ask a list of custom data containers. For example, we want to read only the biometric data

    Response:

    hashtag
    Filter Certificates

    All certificates on the smart card can be dumped at once, or using a filter. In order to read all certificates at once:

    Response:

    The filter can be used to ask a list of custom data containers. For example, we want to read only the rootCertificate

    Response:

    hashtag
    Sign Data

    Data can be signed using the Belgian eID smart card. To do so, the T1C-GCL facilitates in:

    • Retrieving the certificate chain (citizen-certificate, root-certificate and non-repudiation certificate)

    • Perform a sign operation (private key stays on the smart card)

    • Return the signed hash

    To get the certificates necessary for signature validation in your back-end:

    Response:

    Depending on the connected smart card reader. A sign can be executed in 2 modes:

    • Using a connected card reader with 'pin-pad' capabilities (keypad and display available)

    • Using a connected card reader without 'pin-pad' capabilities (no keypad nor display available)

    Security consideration: In order to sign a hash, security considerations prefer using a 'pin-pad'.

    hashtag
    Sign Hash without pin-pad

    When the web or native application is responsible for showing the password input, the following request is used to sign a given hash:

    Response is a base64 encoded signed hash:

    The 'authenticationreference' property can contain the following values: sha1, sha256, sha512, md5.

    hashtag
    Sign Hash with pin-pad

    When the pin entry is done on the pin-pad, the following request is used to sign a given hash:

    Response is a base64 encoded signed hash:

    The 'algorithm_reference' property can contain the following values: sha1, sha256, sha512, md5.

    The core services lists connected readers, and if they have pin-pad capability. You can find more information in the Core Service documentation on how to verify card reader capabilities.

    hashtag
    Bulk Signing

    It is possible to bulk sign data without having to re-enter the PIN by adding an optional bulk parameter set to true to the request. Subsequent sign requests will not require the PIN to be re-entered until a request with bulk being set to false is sent, or the method is called.

    triangle-exclamation

    When using bulk signing, great care must be taken to validate that the first signature request was successful prior to sending subsequent requests. Failing to do this will likely result in the card being blocked.

    hashtag
    Bulk PIN Reset

    The PIN set for bulk signing can be reset by calling this method.

    Response will look like:

    hashtag
    Calculate Hash

    In order to calculate a hash from the data to sign, you need to know the algorithm you will use in order to sign. You might have noticed the algorithm_reference property provided in the sign request. The algorithm_reference can be one of the values: md5, sha1, sha256, sha512. For example, we want the following text to be signed using sha256:

    You can use the following online tool to calculate the SHA256:

    Hexadecimal result:

    Notice that the length of the SHA256 is always the same. Now we need to convert the hexadecimal string to a base64-encoded string, another online tool can be used for this example:

    Base64-encoded result:

    Now we can sign the data:

    Result:

    Note: If you want to convert a binary signed hash to HEX (for development) you can use for example an online hexdump tool:

    hashtag
    Verify PIN

    hashtag
    Verify PIN without pin-pad

    When the web or native application is responsible for showing the password input, the following request is used to verify a card holder PIN:

    Response:

    hashtag
    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:

    Response:

    hashtag
    Verify PIN - retries left

    In order to inform a user upon the PIN retries left, the Belgian eID doesn't provide a request to retrieve this information. After an unsuccessful PIN verification, the error code indicates the number of retries left. For example, when executing:

    The following error message will be returned when PIN is wrong:

    After a second wrong PIN verification:

    Note that, when the user has at least one retry left, entering a correct PIN resets the PIN retry status.

    hashtag
    Authentication

    The T1C-GCL is able to authenticate a card holder based on a challenge. The challenge can be:

    • provided by an external service

    • provided by the smart card An authentication can be interpreted as a signature use case, the challenge is signed data, that can be validated in a back-end process.

      External Challenge

      An external challenge is provided in the data property of the following example:

    Response:

    Take notice that the PIN property can be omitted when using a smart card reader with pin-pad capabilities. The 'algorithm_reference' property can contain the following values: sha1, sha256, sha512, md5.

    Generated Challenge

    A server generated challenge can be provided to the JavaScript library. In order to do so, an additional contract must be provided with the 'OCV API' (Open Certificate Validation API).

    Code

    Description

    301

    Warning: the user can try twice more to verify his PIN

    301

    Warning: the user has only 1 retry left, after this the PIN must be reset at the local municipally

    301

    Error: the PIN is blocked, the PIN must be reset at the local municipally

    Token typings model page
    Bulk Sign Reset
    calculate SHA256arrow-up-right
    hex to base64 converterarrow-up-right
    http://www.fileformat.info/tool/hexdump.htmarrow-up-right
    export interface AbstractEidBE {
      allData(filters?: string[] | Options, callback?: (error: T1CLibException, data: TokenAllDataResponse) => void): Promise<TokenAllDataResponse>;
      allCerts(parseCerts?: boolean, filters?: string[] | Options, callback?: (error: T1CLibException, data: TokenAllCertsResponse) => void): Promise<TokenAllCertsResponse>;
      biometric(callback?: (error: T1CLibException, data: TokenBiometricDataResponse) => void): Promise<TokenBiometricDataResponse>;
      tokenData(callback?: (error: T1CLibException, data: TokenDataResponse) => void): Promise<TokenDataResponse>;
      address(callback?: (error: T1CLibException, data: TokenAddressResponse) => void): Promise<TokenAddressResponse>;
      picture(callback?: (error: T1CLibException, data: TokenPictureResponse) => void): Promise<TokenPictureResponse>;
      rootCertificate(parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
      intermediateCertificates(parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
      authenticationCertificate(parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
      nonRepudiationCertificate(parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
      encryptionCertificate(parseCerts?: boolean, callback?: (error: T1CLibException, data: TokenCertificateResponse) => void): Promise<TokenCertificateResponse>;
      verifyPin(body: TokenVerifyPinData, callback?: (error: T1CLibException, data: TokenVerifyPinResponse) => void): Promise<TokenVerifyPinResponse>;
      authenticate(body: TokenAuthenticateOrSignData, callback?: (error: T1CLibException, data: TokenAuthenticateResponse) => void): Promise<TokenAuthenticateResponse>;
      sign(body: TokenAuthenticateOrSignData, bulk?: boolean, callback?: (error: T1CLibException, data: TokenSignResponse) => void): Promise<TokenSignResponse>;
      allAlgoRefs(callback?: (error: T1CLibException, data: TokenAlgorithmReferencesResponse) => void): Promise<TokenAlgorithmReferencesResponse>
      resetBulkPin(callback?: (error: T1CLibException, data: BoolDataResponse) => void): Promise<BoolDataResponse>;
    }
    T1CSdk.T1CClient.initialize(config).then(res => {
        client = res;
    }, err => {
        console.error(error)
    });
    var beid = client.beid(reader_id);
    beid.biometric(callback).then(res => {
    }, err => {
    });
    var core = client.core();
    core.readersCardAvailable(callback);
    {
      "data": [
        {
          "card": {
            "atr": "3B9813400AA503010101AD1311",
            "description": ["Belgian eID Card"]
          },
          "id": "57a3e2e71c48cee9",
          "name": "Bit4id miniLector",
          "pinpad": false
        }
      ],
      "success": true
    }
    var beid = client.beid(reader_id);
    client.beid(reader_id).biometric(callback);
    function callback(err,data) {
        if(err){
            console.log("Error:",JSON.stringify(err, null, '  '));
        }
        else {
            console.log(JSON.stringify(data, null, '  '));
        }
    }
    {
     "birthDate": "15 JUL  1993",
     "birthLocation": "Roeselare",
     "cardDeliveryMunicipality": "Avelgem",
     "cardNumber": "592..8233",
     "cardValidityDateBegin": "27.05.2015",
     "cardValidityDateEnd": "27.05.2025",
     "chipNumber": "U0xHk...EstwAjEpJQQg==",
     "documentType": "01",
     "firstNames": "Gilles Frans",
     "name": "Platteeuw",
     "nationalNumber": "930...154",
     "nationality": "Belg",
     "nobleCondition": "",
     "pictureHash": "Fqva9YCp...JKyn8=",
     "rawData": "AQw1OTIxMjQwNTgy...TARFBar2vWAqTW+axEIuyskBgFySsp/",
     "sex": "M",
     "signature": "hKys9WMjUm4ipg...14xUCg/98Y9/gP/vgG7JTRZJoKgDXLLTvLZO4qlfA==",
     "specialStatus": "0",
     "thirdName": "J",
     "version": "0"
    }
    client.beid(reader_id).address(callback);
    {
     "municipality": "Hoeselt",
     "rawData": "ARJLZXJrc...AAAAAA==",
     "signature": "mhPyeRg25H...w==",
     "streetAndNumber": "Kerkstraat 2 /0002",
     "version": "0",
     "zipcode": "3730"
    }
    client.beid(reader_id).picture(callback);
    {
      "data": "/9j/4AAQSkZJRgABA...59aVpcklSDzyKUTEDGK//9k=",
      "success": true
    }
    {
      "data": {
        "eid_compliant":48,
        "electrical_perso_interface_version":0,
        "electrical_perso_version":3,
        "graphical_perso_version":7,
        "label":"BELPIC",
        "prn_generation":4,
        "raw_data":"MCcCAQAEEFNMSU4z...JFTFBJQwMCBDCeBAcDAAA=",
        "serial_number":"534C494E..1231C",
        "version":0,
        "version_rfu":0
        },
        "success": true
    }
    client.beid(reader_id).rootCertificate(parseCertsBoolean, callback);
    {
     "certificate": "MIIFjjCCA3agAwIBAgIIO...xg==",
     "parsedCertificate": {...}
    }
    client.beid(reader_id).authenticationCertificate(parseCertsBoolean, callback);
    {
     "certificate": "MIIFjjCCA3agAwIBAgIIO...xg==",
      "parsedCertificate": {...}
    }
    client.beid(reader_id).intermediateCertificates(parseCertsBoolean, callback);
    {
     "certificate": "MIIFjjCCA3agAwIBAgIIO...xg==",
      "parsedCertificate": {...}
    }
    client.beid(reader_id).nonRepudiationCertificate(parseCertsBoolean, callback);
    {
     "certificate": "MIIFjjCCA3agAwIBAgIIO...xg==",
      "parsedCertificate": {...}
    }
    client.beid(reader_id).encryptionCertificate(parseCertsBoolean, callback);
    {
     "certificate": "MIIFjjCCA3agAwIBAgIIO...xg==",
      "parsedCertificate": {...}
    }
    var filter = [];
    client.beid(reader_id).allData({ filters: filter}, callback);
    {
     "picture": {
      "picture": "/9j/4AAQSkZJRgABAgEBLAEsAAD/...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"
     },
     "biometric": {
      "birthDate": "15 JUL  1993",
      "birthLocation": "Roeselare",
      "cardDeliveryMunicipality": "Avelgem",
      "cardNumber": "592124058233",
      "cardValidityDateBegin": "27.05.2015",
      "cardValidityDateEnd": "27.05.2025",
      "chipNumber": "...==",
      "documentType": "01",
      "firstNames": "Gilles Frans",
      "name": "Platteeuw",
      "nationalNumber": "...",
      "nationality": "Belg",
      "nobleCondition": "",
      "pictureHash": "...=",
      "rawData": "...+axEIuyskBgFySsp/",
      "sex": "M",
      "signature": ".../OlA44h4YCM/h+J14xUCg/98Y9/.../C/RB2dtVbHwFvDuafmr4ZEshTlZTLidHKlISFvFWOtsLAEPCbl5LjfQwcOKe0pDADtHb4IStBnr+aaE8oHsTaKq66Y+zt+AbwdmWOrMA5URKKf7dZkY7jt3h8KZDw36VjcytUgjxVIdqwHsDkmIjK6mJtakIwybS5wn3RiQj33/vgG7JTRZJoKgDXLLTvLZO4qlfA==",
      "specialStatus": "0",
      "thirdName": "J",
      "version": "0"
     },
     "address": {
      "municipality": "Hoeselt",
      "rawData": "...==",
      "signature": "...+Evety1PnTE4pqXaHgBxIpk+P8kRL5W3zDV+../../..+YoHBC9KqTmSpl5KULxdnKiyCt+2RyJdzE2wyoymjRmysIhJy1wW9PRnx99S1TFqQLuc0tyBmkBPR4aFqmOq4a7zqd0q2Q1g+BbnwJ4d3oa10ia5+0kBXf0THoXv3HYIHlnwhBMfAtWzPnFrYBuAKTwyl7yBF5IFfXFpGWuVZUTJElgNcmNvsHMnAhVwDw==",
      "streetAndNumber": "Kerkstraat 2 /0002",
      "version": "0",
      "zipcode": "3730"
     }
    }
    var filter = ['biometric'];
    client.beid().allData({ filters: filter, parseCerts: true }, callback);
    {
     "biometric": {
      "birthDate": "15 JUL  1993",
      "birthLocation": "Roeselare",
      "cardDeliveryMunicipality": "Avelgem",
      "cardNumber": "592124058233",
      "cardValidityDateBegin": "27.05.2015",
      "cardValidityDateEnd": "27.05.2025",
      "chipNumber": "...==",
      "documentType": "01",
      "firstNames": "Gilles Frans",
      "name": "Platteeuw",
      "nationalNumber": "...",
      "nationality": "Belg",
      "nobleCondition": "",
      "pictureHash": "...=",
      "rawData": "...+axEIuyskBgFySsp/",
      "sex": "M",
      "signature": ".../OlA44h4YCM/h+J14xUCg/98Y9/.../C/RB2dtVbHwFvDuafmr4ZEshTlZTLidHKlISFvFWOtsLAEPCbl5LjfQwcOKe0pDADtHb4IStBnr+aaE8oHsTaKq66Y+zt+AbwdmWOrMA5URKKf7dZkY7jt3h8KZDw36VjcytUgjxVIdqwHsDkmIjK6mJtakIwybS5wn3RiQj33/vgG7JTRZJoKgDXLLTvLZO4qlfA==",
      "specialStatus": "0",
      "thirdName": "J",
      "version": "0"
     }
    }
    var filter = [];
    client.beid(reader_id).allCerts({ filters: filter}, callback);
    {
     "rootCertificate": {
      "certificate": "..."
     },
     "authenticationCertificate": {
      "certificate": "..."
     },
     "nonRepudiationCertificate": {
      "certificate": "..."
     },
     "intermediateCertificates": {
      "certificate": "..."
     },
     "encryptionCertificate": {
      "certificate": "..."
     }
    }
    var filter = ['rootCertificate'];
    client.beid(reader_id).allCerts({ filters: filter}, callback);
    {
     "rootCertificate": {
      "certificate": "..."
     }
    }
    var filter = null;
    client.beid(reader_id).allCertificates({ filters: filter}, callback);
    {
     "rootCertificate": {
      "certificate": "..."
     },
     "authenticationCertificate": {
      "certificate": "..."
     },
     "nonRepudiationCertificate": {
      "certificate": "..."
     },
     "intermediateCertificates": {
      "certificate": "..."
     },
     "encryptionCertificate": {
      "certificate": "..."
     }
    }
    var data = {
          "pin":"...",
          "algorithmReference":"sha1",
          "data":"I2e+u/sgy7fYgh+DWA0p2jzXQ7E=",
          "osDialog": true
    }
    client.beid(reader_id).signData(data, callback);
    {
      "success": true,
      "data": "W7wqvWA8m9SBALZPxN0qUCZfB1O/WLaM/silenLzSXXmeR+0nzB7hXC/Lc/fMru82m/AAqCuGTYMPKcIpQG6MtZ/SGVpZUA/71jv3D9CatmGYGZc52cpcb7cqOVT7EmhrMtwo/jyUbi/Dy5c8G05owkbgx6QxnLEuTLkfoqsW9Q="
    }
    var data = {
          "algorithmReference":"sha1",
          "data":"I2e+u/sgy7fYgh+DWA0p2jzXQ7E=",
          "osDialog": false
    }
    client.beid(reader_id).signData(data, callback);
    {
        "success": true,
        "data": "W7wqvWA8m9SBALZPxN0qUCZfB1O/WLaM/silenLzSXXmeR+0nzB7hXC/Lc/fMru82m/AAqCuGTYMPKcIpQG6MtZ/SGVpZUA/71jv3D9CatmGYGZc52cpcb7cqOVT7EmhrMtwo/jyUbi/Dy5c8G05owkbgx6QxnLEuTLkfoqsW9Q="
    }
    const data = {
        algorithm: "sha256",
        data: "E1uHACbPvhLew0gGmBH83lvtKIAKxU2/RezfBOsT6Vs=",
        pin: "1234"
    }
    const bulk = true;
    beid.sign(data, bulk).then(res => {
    }, err => {
        console.error(err)
    })
    beid.resetBulkPin().then(res => {
    }, err => {
        console.error(err)
    })
    {
        "success": true,
        "data": true
    }
    This is sample text to demonstrate siging with Belgian eID
    135b870026cfbe12dec348069811fcde5bed28800ac54dbf45ecdf04eb13e95b
    E1uHACbPvhLew0gGmBH83lvtKIAKxU2/RezfBOsT6Vs=
    var data = {
          "pin":"...",
          "algorithmReference":"sha256",
          "data":"E1uHACbPvhLew0gGmBH83lvtKIAKxU2/RezfBOsT6Vs="
    }
    client.beid(reader_id).signData(data, callback);
    {
      "data": "C7SG5eix1+lzMcZXgL0bCL+rLxKhd8ngrSj6mvlgooWH7CloEU13Rj8QiQHdhHnZgAi4Q0fCMIqAc4dn9uW9OP+MRitimRpYZcaDsGrUehPi/JpOD1e+ko7xKZ67ijUU4KTmG4HXc114oJ7xxx3CGL7TNFfvuEphLbbZa+9IZSSnYDOOENJqhggqqu7paSbLJrxC2zaeMxODKb5WSexHnZH6NnLPl2OmvPTYtxiTUMrLbFRsDRAziF6/VQkgM8/xOm+1/9Expv5DSLRY8RQ+wha6/nMlJjx50JszYIj2aBQKp4AOxPVdPewVGEWF4NF9ffrPLrOA2v2d7t5M4q7yxA==",
      "success": true
    }
    var data = {
          "pin":"..."
    }
    client.beid(reader_id).verifyPin(data, callback);
    {
      "verified": true
    }
    var data = {}
    client.beid(reader_id).verifyPin(data, callback);
    {
      "verified": true
    }
      $("#buttonValidate").on('click', function () {
          var _body={};
          _body.pin = $("#psw").val(); //only when no pin-pad available
          var beid = connector.beid(reader_id);
          beid.verifyPin(_body, validationCallback);
      });
    {
      "code": 301,
      "description": "Wrong pin, 2 tries remaining",
      "success": false
    }
    {
      "code": 301,
      "description": "Wrong pin, 1 try remaining",
      "success": false
    }
    var data = {
      "pin": "...",
      "algorithm_reference": "sha1",
      "data":"I2e+u/sgy7fYgh+DWA0p2jzXQ7E="
    }
    client.beid(reader_id).authenticate(data, callback);
    The calculated digest of the hash is prefixed with:
    DigestInfo ::= SEQUENCE {
          digestAlgorithm AlgorithmIdentifier,
          digest OCTET STRING
      }
    Make sure this has been taken into consideration in order to validate the signature in a backend process.
    {
    "success": true,
    "data": "W7wqvWA8m9SBALZPxN0qUCZfB1O/WLaM/silenLzSXXmeR+0nzB7hXC/Lc/fMru82m/AAqCuGTYMPKcIpQG6MtZ/SGVpZUA/71jv3D9CatmGYGZc52cpcb7cqOVT7EmhrMtwo/jyUbi/Dy5c8G05owkbgx6QxnLEuTLkfoqsW9Q="
    }

    Status codes

    hashtag
    HTTP Status Codes

    T1C uses the following HTTP response codes when handling a request.

    In case of an error the response will contain a body with more detailed information about the error:

    All possible values of the codes are described below in "Application Status Codes" The description field contains more information

    hashtag
    Application Status Codes

    circle-exclamation

    These errors are still in draft. These can change until the final release of the v3

    hashtag
    General Trust1Connector errors

    hashtag
    Transaction errors

    hashtag
    Certificate errors

    hashtag
    File (exchange) errors

    hashtag
    Error codes coming from v2

    hashtag
    Internal errors

    {
      description: "some error description",
      code: "some error code"
    }

    function not available

    106

    function not implemented

    107

    service not supported

    108

    service not available

    109

    service not implemented

    110

    Pace layer error

    111

    Reader error

    112

    Notification error

    160

    Digest error

    115

    Initialisation error

    116

    DistributionService error

    117

    Rest exception

    118

    JSON Parsing error

    119

    JWT parsing error

    120

    Forbidden error

    121

    Unauthorized error

    122

    Invalid DS JWE

    123

    Device keystore missing

    125

    Parameter exception

    130

    Proxy service exception

    131

    Invalid T1C state exception

    199

    T1C unavailable exception (JS)

    500

    Agent consent missing or expired (JS)

    configuration related error

    Source '/Users/gilles/Desktop/fileextest/test.plist' does not exist

    355

    112

    No valid dir path returned, no valid file path returned, Timeout, No PIN entered

    356

    804

    No Type with name test was found in entity with name testEnt,

    357

    804

    type with name testType already exists

    358

    not applicable

    error 801 will be thrown with a more detailed message

    359

    not applicable

    360

    805

    Entity with name testEnt already exists

    361

    805

    No Entity with name testEnt was found

    /

    806

    No configuration found (file-exchange config file is missing/deleted…)

    Code

    Description

    100

    general t1c error

    101

    Module not supported

    102

    Module not available

    103

    Module not implemented

    104

    function not supported

    Code

    Description

    300

    General transaction error

    301

    Pin error

    304

    Puk error

    305

    Not supported error

    Code

    Description

    400

    General certificate error

    Code

    Description

    800

    General fileexchange error

    801

    IO exception (files/folder)

    803

    Access exception ( not enough rights )

    804

    Type related errors

    805

    Entity related errors

    Old code

    New code

    example description

    351

    803

    /Library/Updates/ProductMetadata2.plist (Operation not permitted)

    352

    803

    /Library/Updates/ProductMetadata2.plist (Operation not permitted)

    353

    803

    /Library/Updates/ProductMetadata2.plist (Operation not permitted)

    354

    Code

    Description

    900

    Internal error

    105

    806

    801

    Remote loading

    hashtag
    Introduction

    The ReLo (Remote Loading) container is provided through the T1C (Trust1Connector) in order to provide a secured communication channel to executed APDU commands that are generated from a back-end service (which can be optionally signed by a HSM).

    The ReLo provides smart card operations, like for example:

    • open/close session

    • execute APDUs (single or in bulk)

    • retrieve card/card reader features

    • verify if card present

    • retrieve ATR

    • ...

    hashtag
    Communication Flow

    The ReLo-API is an example back-end service implementing different smart card or token profiles (there is no limitation to smart cards). The T1V (Trust1Vault) is a Trust1Team product operating as a secured vault, and integrating with a HSM.

    hashtag
    Available functions

    The following functions are available in the library:

    hashtag
    ReaderId

    The readerId is passed to theremoteloading handler object on initialization. For example, opening a session on reader with idf56c0ffe15a07d09

    hashtag
    Callback/Promise

    All function return Promises by default.

    If you prefer callbacks, each function also has an optional parameter to pass in a callback function. If a callback function is provided, the function will still return a promise, but the callback function will be called when the promise resolves/gets rejected.

    hashtag
    SessionID is optional

    For any function that accepts a sessionIdparameter, the parameter is optional. If a sessionId is provided, the corresponding session will be used for the request and then will be _kept open_once the request completes. This means that if this was the last request that needed to be made, the session needs to be explicitly closed with a call tocloseSession.

    If no sessionId is provided, the request will still complete, but the GCL will set up a new session, perform the required action and then close the session. This means that there is _no open session_once the request completes.

    When a wrong sessionID is sent in a request, an error message will be returned. The status code will be 'invalid sessionID' or 'no active session'

    hashtag
    Interface

    hashtag
    Objects

    hashtag
    Detailed Function Overview

    hashtag
    openSession

    Opens a new session. Returns the sessionId, which will need to be stored by the client application for later use.

    hashtag
    Interface

    hashtag
    Parameters

    • timeout (optional): session timeout in seconds. If not provided, will default to value set in GCLConfig. Must be a number > 0.

    hashtag
    Output

    hashtag
    command

    Sends a command to the reader for execution.

    hashtag
    Interface

    command(tx: string, sessionId?: string, callback: (error, data))

    hashtag
    Parameters

    • tx: command-string to be executed

    • sessionId (optional): sessionId to use. Required if the session needs to be kept open after the request completes.

    hashtag
    Output

    hashtag
    ccid

    Activates a specific CCID feature if it is available on the reader

    hashtag
    Interface

    ccid(feature: string, command: string, sessionId?: string, callback?: (error, data))

    hashtag
    Parameters

    • feature: feature to check

    • command: command to send to the ccid reader (hex format)

    • sessionId (optional): sessionId to use. Required if the session needs to be kept open after the request completes.

    hashtag
    Output

    hashtag
    closeSession

    Closes currently open session.

    hashtag
    Interface

    closeSession(callback?: (error, data))

    hashtag
    Parameters

    • none

    hashtag
    Output

    hashtag
    isPresent

    Checks if the card for this session is still present.

    If no sessionId is provided, checks if a card is present in the reader.

    hashtag
    Interface

    isPresent(sessionId?: string, callback?: (error, data))

    hashtag
    Parameters

    • sessionId (optional): sessionId to use. Required if the session needs to be kept open after the request completes.

    hashtag
    Output

    hashtag
    atr

    Retrieves the ATR for the card currently in the reader.

    hashtag
    Interface

    atr(sessionId?: string, callback?: (error, data))

    hashtag
    Parameters

    • sessionId (optional): sessionId to use. Required if the session needs to be kept open after the request completes.

    hashtag
    Output

    hashtag
    ccidFeatures

    Returns a list of available CCID features for the current reader.

    hashtag
    Interface

    ccidFeatures(sessionId?: string, callback?: (error, data))

    hashtag
    Parameters

    • sessionId (optional): sessionId to use. Required if the session needs to be kept open after the request completes.

    hashtag
    Output

    hashtag
    apdu

    Executes an APDU call on the current reader. The difference with the commandfunction is that theapdu function takes an APDU object, whereas commandtakes a string.

    hashtag
    Interface

    apdu(apdu: ApduObject, sessionId?: string, callback?: (error, data))

    hashtag
    Parameters

    • apdu: object containing the APDU to be executed

    • sessionId (optional): sessionId to use. Required if the session needs to be kept open after the request completes.

    APDU Object interface:

    hashtag
    Output

    hashtag
    Bulk Actions

    For the apduand commandfunctions, it is possible to send an array of apdu's/commands.

    hashtag
    apdus (bulk)

    Executes an array of APDU calls on the current reader.

    hashtag
    Interface

    apdus(apdu: ApduObject[], sessionId?: string, callback?: (error, data))

    hashtag
    Parameters

    • apdu: array containing the APDU objects to be executed

    • sessionId (optional): sessionId to use. Required if the session needs to be kept open after the request completes.

    APDU Object interface:

    hashtag
    Output

    hashtag
    commands (bulk)

    Executes an array of commands on the current reader.

    hashtag
    Interface

    commands(tx: string[], sessionId?: string, callback?: (error, data))

    hashtag
    Parameters

    • tx

      : array containing the command strings to be executed

    • sessionId

      (optional)

      : sessionId to use. Required if the session needs to be kept open after the request completes.

    hashtag
    Output

    Payment typing models

    hashtag
    Introduction

    This page describes all generic payment models used.

    hashtag
    Models

    export class PaymentModuleDescriptionResponse extends DataObjectResponse {
      constructor(public data: PaymentModuleDescription, public success: boolean) {
        super(data, success);
      }
    }
    
    export class PaymentModuleDescription {
      constructor(
          public desc: string
      ) {}
    }
    
    
    export class PaymentVerifyPinResponse extends DataObjectResponse {
      constructor(public data: PaymentVerifyPinResponseData, public success: boolean) {
        super(data, success);
      }
    }
    
    export class PaymentVerifyPinResponseData {
      constructor(
          public verified: boolean
      ) {}
    }
    
    export class PaymentReadData {
      constructor(
          public applications: Array<PaymentApplication>,
      ) {}
    }
    
    export class PaymentApplication {
      constructor(
          public aid?: string,
          public name?: string,
          public priority?: number,
      ) {}
    }
    
    
    export class PaymentReadDataResponse extends DataObjectResponse {
      constructor(public data: PaymentReadData, public success: boolean) {
        super(data, success);
      }
    }
    
    export class PaymentReadApplicationData {
      constructor(
          public country?: string,
          public countryCode?: string,
          public effectiveDate?: string,
          public expirationDate?: string,
          public language?: string,
          public name?: string,
          public pan?: string,
      ) {}
    }
    
    export class PaymentReadApplicationDataResponse extends DataObjectResponse {
      constructor(public data: PaymentReadApplicationData, public success: boolean) {
        super(data, success);
      }
    }
    
    export class PaymentSignResponseData {
      constructor(public success: boolean, public data?: string, public cardSignature?: string, public readerSignature?: string) {
      }
    }
    
    export class PaymentSignResponse {
      constructor(public data: PaymentSignResponseData, public success: boolean) {}
    }

    command response[]

    One or more command to be executed remotely and sequentially. When no session is available, a new session will be opened and immediately closed after execution of the commands.

    ccid

    feature, command, sessionId (optional)

    ccid response

    Trigger a specific CCID feature.

    closeSession

    N/A

    N/A

    Close a session. When no session is available, a new session will be opened and closed. The T1C will be in its initial state.

    isPresent

    sessionId (optional)

    boolean

    Verify if a card is present. When no session is available, a new session will be opened and closed. The T1C will be in its initial state.

    atr

    sessionId (optional)

    ATR for card

    Retrieve ATR from card. When no session is available, a new session will be opened and closed. The T1C will be in its initial state.

    ccidFeatures

    sessionId (optional)

    list of features

    List of card readers features available for CCID. When no session is available, a new session will be opened and closed. The T1C will be in its initial state.

    apdu

    apdu object, sessionId (optional)

    apdu response

    Execute a single APDU command. When no session is available, a new session will be opened and closed. The T1C will be in its initial state.

    apdus

    apdu[], sessionId (optional)

    apdu response[]

    Execute one or more APDU commands (APDU bulk). When no session is available, a new session will be opened and closed. The T1C will be in its initial state.

    JavaScript API

    Function

    Input

    Output

    Description

    openSession

    session timeout in seconds

    sessionId

    Opens a remote session, the session will be accessible through a session-id. The T1C will keep the session open and reusable.

    command

    tx, sessionId (optional)

    command response

    A single command to be executed remotely. When no session is available, a new session will be opened and immediately closed after execution of the command.

    commands

    tx[], sessionId (optional)

    interface AbstractRemoteLoading {
        atr(sessionId?: string, callback?: (error: T1CLibException, data: DataResponse) => void): Promise<DataResponse>;
        apdu(apdu: APDU, sessionId?: string, callback?: (error: T1CLibException, data: CommandResponse) => void): Promise<CommandResponse>;
        apdus(apdu: APDU[], sessionId?: string, callback?: (error: T1CLibException, data: CommandsResponse) => void): Promise<CommandsResponse>;
        ccid(feature: CCIDFeature, command: string, sessionId?: string, callback?: (error: T1CLibException, data: CommandResponse) => void): Promise<CommandResponse>;
        ccidFeatures(sessionId?: string, callback?: (error: T1CLibException, data: DataResponse) => void): Promise<DataResponse>;
        command(tx: string, sessionId?: string, callback?: (error: T1CLibException, data: CommandResponse) => void): Promise<CommandResponse>;
        commands(tx: string[], sessionId?: string, callback?: (error: T1CLibException, data: CommandsResponse) => void): Promise<CommandsResponse>;
        closeSession(sessionId?: string, callback?: (error: T1CLibException, data: DataResponse) => void): Promise<DataResponse>;
        isPresent(sessionId?: string, callback?: (error: T1CLibException, data: BoolDataResponse) => void): Promise<BoolDataResponse>;
        openSession(timeout?: number, callback?: (error: T1CLibException, data: DataResponse) => void): Promise<DataResponse>;
    }
    export enum CCIDFeature {
        VERIFY_PIN_DIRECT = 'VERIFY_PIN_DIRECT',
        MODIFY_PIN_DIRECT = 'MODIFY_PIN_DIRECT',
        GET_TLV_PROPERTIES = 'GET_TLV_PROPERTIES'
    }
    openSession(timeout?: number, callback?: (error, data))
    {
        data: string // sessionId string
        success: boolean
    }
    {
        data: {
            tx: string, // input
            rx?: string, // output
            sw: string  // status word
        }
        success: boolean
    }
    {
        data: string // ccid response
        success: boolean
    }
    {
        success: true
    }
    {
        data: boolean // true if present, false if not
        success: boolean
    }
    {
        data: string // ATR string
        success: boolean
    }
    {
        data: Ccid[]
        success: boolean
    }
    {
        cla: string
        ins: string
        p1: string
        p2: string
        data?: string
        le?: string
    }
    {
        data: {
            tx: string, // input
            rx?: string, // output
            sw: string  // status word
        }
        success: boolean
    }
    {
        cla: string
        ins: string
        p1: string
        p2: string
        data?: string
        le?: string
    }
    {
        data: {
            tx: string, // input
            rx?: string, // output
            sw: string  // status word
        }[] // Array of response objects
        success: boolean
    }
    {
        data: {
            tx: string, // input
            rx?: string, // output
            sw: string  // status word
        }[] // Array of response objects
        success: boolean
    }

    Concept

    Running the Trust1Connector in a shared environment, such as Citrix, XenApp and Remote Desktop, requires additional installation steps. In this section we explain the concept and approach used.

    hashtag
    Architecture Overview

    The following schematic seems rather complicated as it explains the inner workings of the Trust1Connector components, the concept is elaborate further on this page. If you are only interested in what the integration impact is for your Web Application in a Shared Environment, you can skip directly to the section: Integration in Web Applications

    hashtag
    Components

    hashtag
    Web Environment

    The Web Application can use the T1C-SDK-JS or a custom REST API client for integration purpose. As the Web Application operates in a browser context, resolving an agent, by means of a consent, will result in a browser cookie being provided.

    The T1C-SDK-JS implements the detection of a Shared Environment during the initialisation of the library. When initialisation succeeds without a controlled exception, the setup is a standalone; when the initialisation throws an 401 Error, the T1C-SDK-JS can be used to request the user for a Consent.

    When using the REST API directly form your web application, reading the browser cookie and performing the initialisation must be done by the integrating Web Application itself.

    hashtag
    Shared Environment Host

    Compared to Trust1Connector v2, the v3 release has a separate component to be be installed on a shared host. This component is called the T1C-Proxy and only exposes the following use cases:

    • Verify random available ports [in a predefined range] which can be used by an Agent (Session of T1C-API running in user space)

    • Port reservation upon installation of a new T1C-API in an active user session

    • Port registration upon initialisation of a T1C-API in an active user session

    The T1C-Proxy operates by Default on the API port defined in the T1C-DS (Distribution Server). From a Web Application perspective, this is the only information known. When a Web Application requests the information of the device, the PROXY device type will inform the Web Application that the targeted underlying API is a PROXY, which means that the Web Application must ask for the Agent specific API port to configure an URI which can be used to execute the use cases.

    When using the T1C-SDK-JS this is done implicitly during initialisation.

    hashtag
    Shared Environment Client

    A T1C-API installed for a specific users runs in [User Space]. To avoid possible attack vectors, the Trust1Connector v3 will always run in [User Space].

    Upon installation of the T1C-API, during the post install phase, the T1C-API will try to verify automatically if it is running in a shared environment. If this is the case, the T1C-API will ask the T1C-Proxy for available ports and will reserve those post, prior to initialisation and startup.

    The ports which are reserved by the T1C-Proxy are the following:

    • T1C-API Port: This is the port exposing the OpenAPI interface towards Web Applications and used by the T1C-SDK-JS

    • T1C-gRPC Port: This is the port exposing the gRPC interface locally towards the T1C-API component. The T1C-gRPC runs in a sandboxed and hardened environment, it contains the implementation modules needed for hardware communication with local or remote peripherals.

    When receiving ports during post-install, an user agent device is temporary RESERVED in the Agent Registry of the T1C-Proxy. Upon T1C-API initialisation, the port configurations will be confirmed and the Agent Registry will set the device state on REGISTERED. From this moment on, a T1C-API instance, running in an active user session, will be available for the Web Application.

    The T1C-gRPC instance is inherently a component from the T1C-API, and thus is managed by the T1C-API. As each user must have it's own hardened runtime for communication purpose, the port assigned for T1C-gRPC will be registered and configured by the T1C-API (and restarted when needed).

    hashtag
    Central Back-Office

    Starting from this release (v3) of the Trust1Connector, each device must have a link with an active and running T1C-DS (Trust1Connector Distribution Server). This is to guarantee security, updates, and avoid potential risk in production.

    The T1C-DS is proceeded by an API Gateway who is managing the security offloading in the application layer. For a Web Application to communicate with a T1C-Proxy or T1C-API, a JWT (Json Web Token) is needed and obliged. The T1C-DS is responsible for the key management, the certificate management and other use cases which are described in a separate wiki.

    In order to retrieve a valid JWT, the T1C-DS can be requested from your application back-end with a valid api-key. The JWT is valid for a given amount of time, and sets the context used when requesting the T1C-API on a device.

    hashtag
    Security

    hashtag
    Share Environment Flows

    hashtag
    Communication Stack

    Management of an in-memory list of active Agents

  • Management of user consents in a shared environment by means of browser cookies with an optional configurable TTL (time to live)

  • Release Notes

    hashtag
    v3.1.4

    hashtag
    Bug

    • File digests config doesn't take the path differences between Mac OS and Windows into account

    • PKCS11 configuration cookie cannot be created on Windows devices

    • PKCS11 returns null pointer exception when no pin is provided

    • Unresolved address exception when the Trust1Connector is installed or started without internet connection

    hashtag
    Story

    • As an end user I can use RMC with the new T1C v3 for the belgian eID and the file exchange

    • Windows installers are signed with the Trust1Team certificate

    • Windows installer includes the firewall settings upfront

    hashtag
    v3.1.3

    hashtag
    Bug

    • PKCS11 SlotId in config issue

    • Fileexchange when canceling file or directory dialogs, no error is thrown but an empty path is returned

    • Catch errors with regards to the GRPC service nog being running

    hashtag
    Story

    • Cookie implementation for the Trust1Connector JS SDK in shared environments

    hashtag
    v3.1.2

    hashtag
    Bug

    • check fileexchange file/directory access rights before executing the command

    • After reinstallation the v3.0.1 of the t1c api config defines its running in a shared environment but there are no other instances running on the machine

    • When no connector is installed no valid error code is returned in JS

    hashtag
    Task

    • Move file location of the T1C v3 file-exchange config to the new folder structure instead of using the old folder structure

    hashtag
    Story

    • Audit logging for tampering checks in the Trust1Connector

    • Configure logging for T1C-API

    • Keep audit record for lifecycle changes T1C-API (restart sandbox, ...)

    All endpoints communicating with smartcards/tokens/... need to be protected by means of JWT
  • Support for silent install on Win Platforms

  • Remove sensitive system info from API & Proxy exposed on /info endpoint

  • Remove from API & Proxy the temp folder path on the /info

  • Provide the possibility to use PKCS11 objects instead of keystores

  • Integrate PKCS11 container in the sandbox-service

  • Maintain a transaction log with labels

  • Ability to do bulk signing with the generic token interface

  • File IO needs to check if access rights for file are fulfilled otherwise return 803
  • Fileexchange v2 recovery failed due to wrong encoding

  • T1C JS SDK fix typo for responseObject info endpoint

  • Typescript typings are conflicting with eachother (generics)

  • T1C SDK pkcs11generic slots should be numbers instead of strings

  • Play.pid blocking reinstallation of Trust1Connector API

    As an integrator I want to have the RemoteLoading functionality in REST available
  • Keep DS logs for 1 year

  • As the Trust1Connector I want the Sandbox to have an automatic recovery when an unexpected shutdown happens

  • Add parameter validation to each endpoint which requires it

  • Consent

    hashtag
    Introduction

    The Trust1Connector supports 2 different user consent mechanisms for applications:

    • implicit user consent: the user will be provided with a consent token which can be pasted into his clipboard. The T1C-GCL will implicitly retrieve the consent token form the clipboard and perform a verification (the token pasted in the clipboard - form the application context - should match with the token available on the clipboard for the T1C-GCL)

    For an implicit consent, the T1C is performing the verification of the shared code word.

    The consent can be configured to have an expiration date, when this expiration date has been exceeded, a new consent will be asked towards the user.

    circle-info

    The implementation of the consent flows only apply with the T1C JS SDK. Implementation with the API directly is different

    hashtag
    Consent dialog for implicit consent

    If the consent has been enabled upon installation of the Trust1Connector, a user will not be able to retrieve any data from the connector without first giving its consent, agreeing to give access to his/her card reader of filestorage. Without this consent, all requests will return a 401 Unauthorized response with error code 500 No valid consent found or at initialisation of the Trust1Connector SDK an error code 500 No valid consent found. The application should detect these error codes and use it to trigger the consent dialog.

    The application shows this code word on screen and provide a button for 'copy-to-clipboard'. When the user has copied the code word to the clipboard (on user click button event), an implicit consent request can be executed towards the T1C. The T1C will grab the pasted code word from the user system clipboard and if both match, an implicit user consent has been granted for the calling application. The relation between the application and the local T1C instance is 'approved'. At this point the Trust1Connector returns a cookie that should be stored in the browser. This cookie will be re-used the next time the user wants to use the Trust1Connector until the cookie expires.

    hashtag
    User clipboard remark

    Initially the concept was based on copying programmatically the code word, from the application context, to the user system clipboard. Although, through CAB forum, this not allowed; A user interaction is mandatory. The application should provide a 'copy-to-clipboard' button or alike in order to 'trigger' a user action. Once this action has been done, the T1C executes the flow automatically, this is retrieval and verification of the code word.

    Currently, the need for a user interaction is a known limitation (aka. ). As this is the case, the W3C has a project ' ' to propose a solution for a new clipboard API in browsers. The use case for 'Remote clipboard synchronisation' as a use case included in this draft proposal. As this is a draft, and not yet supported by the browsers, we can not perform an automatic 'paste' ('copy' in terms of the browser) to the clipboard.

    Sending an implicit consent request can be done as follows:

    This call has 1 required and 2 optional parameters:

    1. Code Word (required): a code word in string format that will be shown in the consent dialog.

    2. Consent duration in days (optional): Allows the application the specify how long this consent is to be valid if granted

    3. Callback function (optional): function to be called with the result of the consent request.

    The response of the consent will be an updated T1C Client which you after this point can use to continue your use-case(s).

    The response can also be a 400 Bad Request with status code 115 "No agents registered to the proxy service" which means that the request has been sent with the unique code but the Proxy cannot not find the user associated with it by checking the clipboards of all connected users.

    This could mean that there is no T1C API client present or it is not running correctly.

    Quick-Migration Guide

    hashtag
    Introduction

    Migration from the v2 to the v3 of the Trust1Connector can be done in 2 ways;

    1. Integration of the API

    2. Integration via the deprecated Javascript SDK

    Both are viable integrations but we strongly suggest to integrate via the API since the JS SDK does not include all features, only the ones which were available in the v2. When integrating via the API you have more control over the Javascript packages used.

    The Javascript SDK has the following packages as dependencies;

    hashtag
    Update a v2 application to v3

    For updating your web application first of all you need to use the new Javascript SDK. After this there are some differences in using the SDK from the v2.

    hashtag
    Configuration

    The configuration from the v2 has changed, we simplified this.

    The v2 had the following configuration options;

    With the v3 this is significantly simplified to the following;

    circle-exclamation

    Some of the config options of the v3 are still in review and can be removed up until the final release of the v3, in the table below you will find more information

    hashtag
    Initialisation

    After you've created your configuration object you can do the initialisation of the Trust1Connector SDK. This has largely remained the same except for the error codes.

    V2 example:

    V3 example;

    Core Service

    hashtag
    Introduction

    The Trust1Connector core services address communication functionality with local devices. The Trust1Connector core exposes 2 main interfaces:

    • interface for web/native applications using JavaScrip/Typescript

    • REST API as a new approach and to incorporate the Trust1Connector as a microservice in the application architecture

    In this guide, we target only the use of Trust1Connector's core interface for web/native applications. The T1C-SDK-JS exposes protected resources for administration and consumer usage.

    The JavaScript library must be initialized with a correct token in order to access the all resource. The security policy for Trust1Connector v3 secured ALL endpoints.

    hashtag
    Administration resources

    Protected resources are administration resources. The JavaScript library must be initialized with a correct token in order to access the resource.

    • Download Trust1Connector installer

    • Get Information of the device and user context

    • Register T1C for device

    Executing these functionality is explained further.

    hashtag
    Consumer resources

    Consumer resources are typically used from an application perspective:

    • Get pub-key certificate

    • Get version

    • Get Information (operating system, runtime, user context, variable configuration)

    Executing these functionality is explained further.

    hashtag
    Core Functionalities

    The Trust1Connector functionalities are about secured communication with device hardware. The document highlights communication with smart card readers - contact and contact-less. Other hardware devices can be enabled or integrated as well in the solution. Some of the already are, for example printer drivers, signature tablet drivers, ...

    hashtag
    Initialize the client library

    The client can be initialized by passing a T1CConfig object in the constructor

    hashtag
    List card readers

    Returns a list of available card readers. Multiple readers can be connected. Each reader is identified by a unique reader_id.

    The response will contains a list of card readers:

    When multiple readers are attached to a device, the response will show all connected card readers:

    Important to notice:

    • The response adds a card-element when a card is inserted into the card reader.

    • The response contains card-reader pin-pad capabilities

    hashtag
    Card Inserted

    As mentioned in the List card-readers, when a smart-card is inserted/detected, the reader will contain the cart-type based on the ATR. The ATR (Anwser To Reset), is the response from any smart-card when powered, and defines the card type. The Trust1Connector recognized more than 3k smart-card types.

    hashtag
    Pin-Pad Capabilities

    As mentioned in the List card-readers, when a card-reader has pin-pad capabilities, this will be mentioned in the response (notice the pinpadproperty):

    hashtag
    List Card-Readers - Explained Example

    The following example is the response for List card-readers on a device with 4 different card-readers attached:

    In the above example you notice that 4 card-readers are connected. Each card-reader receives his temporary id which can be used for other functions where a card-reader id is needed. This method can be requested in order to list all available card-readers, and optional cards-inserted. Each card-reader has a vendor provided name, which is retrieved from the card-reader itself. An additional property pinpad, a boolean value, denotes if the card-reader has pin-pad capabilities. A pin-pad is a card-reader, most of the times with its own display and key-pad. From a security perspective, it's considered best practice to use as much as possible pin-pad capabilities of a pin-pad card-reader. When a reader has a smart-card inserted (contact interface) or detected (contactless interface), the card type will be resolved by the GCL in order to respond with a meaningful type. In the above examples you see that; one card-reader has a Belgian eID card; another card-reader has a MisterCash or VISA Card available for interaction.

    The readers returned, are the card-readers with a card available. The card-readers where no card is presented, are ignored.

    hashtag
    Get card reader with card inserted

    Returns a list of available card readers with a smart card inserted. Multiple readers can be connected with multiple smart cards inserted. Each reader is identified by a unique reader_id and contains information about a connected smart card. A smart card is of a certain type. The Trust1Connector detects the type of the smart card and returns this information in the JSON response.

    Response:

    hashtag
    Download T1C Installer

    The T1C JS SDK no longer has a method to download the T1C installer.

    Instead, the T1C installer can be downloaded by navigating the client browser to the /v3/downloads/installer endpoint of the Distribution Service (e.g. https://acc-ds.t1t.io/v3/downloads/installer). The Distribution Service will analyze the User-Agent header and automatically initiate the download of an OS-appropriate installer of the latest configured version. The user agent string parsing is considered "best-effort"; as they can vary wildly depending OS and browser software.

    Alternatively, you can also initiate the download of a T1C installer with the following endpoints:

    1. /v3/downloads/installers/{{OS}}: This endpoint allows you to specify the OS for which you wish to obtain an installer. The possible values are win32, win64, unix, macos.

    2. /v3/downloads/installers/{{OS}}/versions/{{version}}: This endpoint allows you to download a specific version of a T1C installer for a specific OS.

    hashtag
    Get Information

    Configuration

    hashtag
    Introduction

    In order to use the JS-SDK, the library must be initialised with an api-key. The api-key is a key received upon subscription. The JS-SDK is a client library for web based consumers. As a reminder, the T1C can be used from a native applications context using a native client, or addressing directly the T1C interface. In order to work with an api-key in a browser context, 2 type of consumers can be distinguished:

    Integration in Web Applications

    A Web Application interacts with the Trust1Connector on standalone devices or within a shared environment. The Web Application is not aware, but must take this into consideration upon integration.

    Integrating the Trust1Connector can be done via the Javascript SDK. This SDK is compiled in regular javascript and in Typescript. Each release of the Javascript SDK will have the following files;

    • dist

      • T1CSdk.js (complete SDK)

    Token typing models

    hashtag
    Introduction

    This page describes all generic token models used.

    hashtag
    Models

    Idemia Cosmo One v8.2

    hashtag
    Introduction

    The ID-One Cosmo V8-n is part of the Idemia IAS ECC family of cryptographic modules called ID-One Cosmo V8. Modules within this family share the same functionalities and the description of the ID-One Cosmo V8 applies to all versions including the “-n” subject to this validation. This document describes the functionality provided by the Idemia IAS ECC ID-One smartcard - which is a PKI container - on the T1C-GCL (Generic Connector Library) implemented version:

    Luxembourg ID

    hashtag
    Introduction

    The Luxembourg ID container facilitates communication with card readers with inserted Luxembourg ID smart card. The T1C-JS client library provides function to communicate with the smart card and facilitates integration into a web or native application. This document describes the functionality provided by the Luxembourg ID container on the T1C-GCL (Generic Connector Library).

    hashtag

    Authenticated client

    hashtag
    Introduction

    The Trust1Connector API requires a valid JWT token to be provided in the Authorization header. This JWT token can be retrieved by asking the Distribution Service to generate a token for a specific API-key. It is important that this API-key is not exposed in the front-end application as this is a security violation.

    When you've received a valid JWT token from the DS you can provide this into the configuration object when initialising the Trust1Connector JS client.