> ## Documentation Index
> Fetch the complete documentation index at: https://docs.futurex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Microsoft SignTool commands

> Demonstrates usage of signtool sign and verify commands to validate the setup.

This section runs the following Microsoft SignTool commands: **signtool sign** and **signtool verify**.

<Note>
  The signtool sign command is relevant to this integration because it is the only SignTool command that initiates communication with the CryptoHub. SignTool must be able to access the private key stored in CryptoHub to complete the code signing operation successfully.
</Note>

## Sign a file

<Note>
  The following example signs an `.exe` file, but you can sign other types of files by using SignTool. See the following document for details:

  [https://docs.microsoft.com/en-us/windows/win32/seccrypto/cryptography-tools](https://docs.microsoft.com/en-us/windows/win32/seccrypto/cryptography-tools)
</Note>

Perform the following steps to sign a file using the configured code Signing certificate:

<Steps>
  <Step>
    Open PowerShell or Windows Command Prompt and run the following command, replacing**MyCertificate** with the **Subject Name** of your certificate and **example.exe** with the name of the file that you are signing:

    ```powershell expandable lines wrap title="PowerShell" theme={null}
    signtool sign /sm /fd sha256 /s My /n "MyCertificate" example.exe
    ```

    <Check>
      If the command succeeds, you should receive the following message:

      ```none expandable lines wrap title="None" theme={null}
      Done Adding Additional Store
      Successfully signed: example.exe
      ```
    </Check>
  </Step>
</Steps>

## Verify the file

To verify the file that was signed, run the following command:

```text expandable lines wrap title="Text" theme={null}
signtool verify /pa example.exe
```

<Check>
  If the command succeeds, you should see output similar to the following example:

  ```none expandable lines wrap title="None" theme={null}
  File: example.exe
  Index  Algorithm  Timestamp
  ========================================
  0      sha1       None

  Successfully verified: example.exe
  ```
</Check>
