# Signing

In this page we will go over which steps need to be taken for codesigning the Trust1Connector package in Windows and MacOS

## Prerequisites

For codesigning you'll need to undertake a couple of steps first

* Windows
  * Aquire a code signing certificate
  * Visual studio (signtool)
  * Signtool available on the path

## Signing the package

### Windows

When you have Visual studio installed and you've create the EXE of the Trust1Connector you can begin the singing process. This is a very simple process and can be added in the packaging script for convinience.

#### Step 1

You need to open a command line promt at the location of the EXE file.

#### Step 2

Enter the command for signing, the code below is an example of how we sign with the Code signing certificate of Trust1Team.

```bash
$ signtool sign /f "%CODE_SIGNING_CERTIFICATE%" /csp "eToken Base Cryptographic Provider"  /k "[{{qf4tT#M2TFXQ}}]=te-b90294a5-58b2-46b8-8c17-0c521e751c52" /fd sha256 /t http://timestamp.globalsign.com/scripts/timestamp.dll Output\T1C-Proxy_x64.exe
```

If you want to use your own code signing certificate we strongly suggest to also read the official Windows documentation regarding code signing. They also provide examples.\
Documentation for the signtool can be found here: [Sign tool docs](https://docs.microsoft.com/en-us/dotnet/framework/tools/signtool-exe#sign-command-options)

## FAQ

### 'signtool' is not recognized as an internal or external command, operable program or batch file.

Set the path to the signtool exe in your environment variables\
<https://stackoverflow.com/questions/48965862/how-to-get-path-to-signtool-exe-with-visual-studio-2017-installed?rq=1>
