# Source Code

## Dependencies

The GCL is distributed through a Distribution Service. In order to use the Distribution Service, a valid api-key is needed. The JavaScript library is open source and distributed through:

* Github repository
* NPM package

### Github Repository

* [T1C-JS client library](https://github.com/Trust1Team/t1c-lib-js)
* [T1C-JS simple HTML page using jQuery](https://github.com/Trust1Team/t1c-lib-js/blob/develop/index.html)
* [T1C-Demo web application](https://github.com/Trust1Team/t1c-webapp-demo) (TBD)

### NPM Package

Bower can be used to add the T1C-JS package to your web application project:

```bash
$ npm install trust1connector
```

## Distribution Service API

OpenAPI [(JSON)](https://storage.cloud.google.com/gcl-distro/apis/t1c-ds_v0.5.0.json) [(YAML)](https://storage.cloud.google.com/gcl-distro/apis/t1c-ds_v0.5.0.yaml)

## JVM

Important to know that `Trust1Connector` does **NOT** have any dependencies on Java Virtual Machine.

## Build T1C-JS from source

Webpack is need to build the Javascript library

```bash
$ npm install --global webpack
```

Typings must be installed for typing generation

```bash
$ npm i -g typings
```

For jQuery we need to install from dt source

```bash
$ typings install dt~jquery --global --save
```

Debug:

```bash
$ typings install debug --save
```

Use npm install to download the necessary dependencies

```bash
$ npm install
```

Use gulp test to run the test suite of the project

```bash
$ npm run test
```

To build the Javascript library:

```bash
$ npm run build
```

## Certificate functionality <a href="#certificate-functionality" id="certificate-functionality"></a>

The certificate parsing happens with PKI.js already but if you want more certificate functionality we recommend you use:

* Asn1js <http://asn1js.org/>​
* PKI.js <https://pkijs.org/>​


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://t1t.gitbook.io/t1c-js-belfius-guide/core/source-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
