Skip to main content

Code signing custom builds

Code signing is an essential process for ensuring the authenticity and integrity of your custom Mattermost builds. This guide provides steps on how to code sign a build using your own certificates for Windows, Mac, and Linux.

Prerequisites

  1. Code Signing Certificate: Obtain a certificate from a Certificate Authority (CA) or use a self-signed certificate if suitable.
  2. SignTool: Available as part of the Windows SDK.

Process

  1. Install SignTool: Install the Windows SDK to access the SignTool utility.

  2. Obtain a Code Signing Certificate: Purchase or create a certificate (.pfx file) via a CA.

  3. Import the Certificate: Open the .pfx file and import it into the Windows Certificate Store.

  4. Sign the Executable

    • Open the command prompt as Administrator.
    • Use SignTool to sign your executable:
    signtool sign /v /s "My" /sha1 <cert hash> /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 <path-to-your-executable>

Summary

  • Windows: Use SignTool from the Windows SDK with your imported code signing certificate.
  • Mac: Use codesign and spctl tools from Xcode with your Apple Developer ID certificate.
  • Linux: Use GnuPG to create/sign with your GPG key, dpkg-sig for .deb packages, and rpmsign for .rpm packages.