CodeSign Secure Documentation
  • Overview
    • About CodeSign Secure
    • Getting Started
    • Documentation Guide
    • Portal Overview
    • Troubleshooting
      • FAQ
    • Glossary
  • Reference Guide
    • Header Bar
      • CodeSign Secure Documentation
      • Swagger API
      • Profile Section
    • Dashboard
      • Key Performance Indicators
      • Issued Certificates
      • Signatures Generated
      • HSM Health Check
    • Keys and Certificates
      • Key and Certificate Lifecycle
    • App Management
    • Signing Requests
      • Approval Workflows
    • Signing Tools
    • Reports
      • Signing Request Report
      • Audit Trail
      • Certificate Report
      • Client Report
    • Logs
    • System Setup
      • Identity Store
      • Backup
      • User
      • Roles and Permissions
      • Email
      • Signing Projects
      • SSL/TLS Management
      • Environment
      • Plugins
  • Setup & Architecture
    • Identity and Access Control
    • Architecture and Concepts
    • Installation
      • Windows
        • Installing the Server
        • Ports and Protocols
        • High Availability and Backup
        • Upgrades and Compatibility
    • Security
      • Security Hardening Checklist
      • Client Authentication
      • Designing Signing Policies
  • Release Notes
    • Releases for 2026
      • v3.2.1
    • Releases for 2025
      • v3.2.0
    • Releases for 2024
      • v3.1.0
  • API Reference
    • Getting Started
    • Authorizing Requests
    • Securing API Access
    • Request and Response Conventions
    • Endpoint Reference
      • Signing
      • Signing Requests
      • Certificates
      • Applications and Environments
      • User Management
      • Permissions
      • Email
      • System Setup
      • Reports
      • Dashboard
      • License
  • Integration Guides
    • Signing Capabilities
      • Supported Formats and Platforms
      • Timestamping
      • Windows Signing - SignTool
        • Signing
        • Macro Signing
      • Apple Signing
      • AppX & MSIX Signing
      • Visual Studio ClickOnce
      • Jar Signing
      • Sign HLK/HCK using CodeSign Secure
      • NuGet Signing
      • Mage Signing
      • Sign OVA/OVF using Encryption Consulting’s Utility Tool
      • Utility Tool for code signing
      • Container Signing
      • PKCS11 Wrapper
        • APK Signing
        • OpenSSL Signing
        • XML Signing
        • JSign Tool Signing
        • Jarsigner Signing
        • GPG2, Debian & RPM Signing
      • Reproducible Build
        • Automated Hash Validation
        • Reproducible Build Process Flow
        • Pipeline Script Components
        • Hash Validation
    • CI/CD Integration
      • GitHub Actions
      • Jenkins
      • GitLab
      • Azure DevOps
      • TeamCity
      • Bamboo
      • Securing CI/CD Credentials

GitLab

Using Gitlab for code signing process require you to set up a runner which has Signtool, ECSigningKSP and a GitLab Account. Listing down the pre-requisites:

  1. Self Hosted Runner which has ECSigning KSP, Signtool installed and configured. This runner should be provided with Administrative privileges.
  2. A GitLab Account.

To set up the ECSigningKSP and Signtool please navigate to the Windows Signing page. After doing so, please follow the steps below:

  • Set Up a GitLab Account. Navigate to creating a New Blank Project.
  • Scroll down to settings -> CI/CD and navigate to runner. Expand it.

    Gitlab Runner

  • Install GitLab runner in your device using the link. This link is for Windows. You can look this link to see steps to Install it in your specific device.
  • You can follow the documentation to set up your runner and register it as per your device.

To register a runner under Windows:

  1. Run the following command:

    .\gitlab-runner.exe register

  2. Enter your GitLab instance URL (also known as the gitlab-ci coordinator URL). Example: https://gitlab.com
  3. Enter the token you obtained to register the runner. You can access this from settings -> CI/CD -> Expand -> Project runners. Under project runners you can find token.
  4. Enter a description for the runner. You can change this value later in the GitLab user interface. Example: Device
  5. Enter the tags associated with the runner, separated by commas. You can change this value later in the GitLab user interface. Example: WindowsRunner
  6. Enter any optional maintenance note for the runner.
  7. Provide the runner executor. We’re operating this in Shell.

Once the runner is installed and configured, navigate to services in your device, scroll down to GitLab Runner and set log on as Administrator. Provide Admin Password here.

Gitlab Runner Properties

Once this is done, go to your project. You might have to rename the .yml file name. Rename it as .gitlab-ci.yml.

There are three sections in this pipeline.

  1. Tags

    The tags you provided while setting up the runner

  2. Variables

    EC_Client_Auth : Corresponds to the path of your SSL Authentication certificate which can be created from CodeSignSecure.

    EC_Client_Pass : Corresponds to the password of your certificate which is provided at the time of creation of the certificate.

  3. Script

    Provide the signtool command to sign a file.

A sample script is given below to perform codesigning.

                    
                                    job1:
                                            tags:
                                                    - shell
                               
                                            variables:
                                                    EC_Client_Auth: C:\Users\riley\Documents\EncryptionConsulting\Test_demo.pfx
                                                    EC_Client_Pass: c74c5b7db312
                               
                                            script:
                                                    - signtool sign /csp "Encryption Consulting Key Storage Provider" /kc Test_aryan90 /fd SHA256 /f "C:\Users\riley\Desktop\gitlab\Test_aryan90.pem" /tr http://timestamp.digicert.com /td SHA256 "C:\Users\riley\Desktop\agent.exe"                           
                                                
                                

Gitlab File Editor

If you click on Build -> Jobs, you'll see it being successfully signed.

Gitlab Jobs

You'll need to modify the command as per your variables

  • kc <certificate name>: replace Test_aryan90 with your key name
  • f <certificate location>: replace location with location of your certificate .pem file to perform codesigning.
  • tr http://timestamp.digicert.com: time stamping server
  • td SHA256 <file location>: location of file you want to get signed.
On this Page:
Support Privacy Policy Terms of Service

Copyright Encryption Consulting LLC. All rights reserved.