Coming Soon: Binary Signing for GitLab CI/CD
DigiCert Binary Signing for GitLab CI/CD enables organizations to seamlessly integrate secure code signing into GitLab pipelines using DigiCert® Software Trust Manager.
This production-ready CI/CD template supports Linux, macOS, and Windows runners, offering both simplified and traditional signing workflows to align with diverse build and release strategies.
The template automates the setup and execution of DigiCert signing tools, enabling secure keypair-based signing while ensuring private keys remain protected within Software Trust Manager. This approach eliminates direct key exposure in CI environments and strengthens overall signing security.
Supported signing approaches
Simple signing:
Uses the DigiCert SMCTL command-line tool (installed automatically by this template) to sign files directly from the pipeline.
Supports bulk signing of directories.
Traditional signing:
Integrates with third-party signing tools using the following libraries:
JCE
PKCS#11
KSP
CSP
Features:
Cross-platform support: Linux, macOS, and Windows.
Bulk signing support (only for simple signing). Using bulk signing you can sign multiple files at a time.
Secure integration with GitLab Secure Files.
Automatic tool download and caching.
JCE, PKCS#11, KSP, and CSP support for traditional workflows.
Production-ready error handling, logging, and best practices built-in.
Before you begin
Active Software Trust Manager Account.
Active subscription with Software Trust Manager.
API key with signing permissions.
Client certificate (
.p12file) with password.Set up GitLab Project.
GitLab project with CI/CD enabled.
GitLab runner (SaaS or self-hosted) for your target platform.
Configured required environment variables (see configurations table below).
Variable | Default | Description |
|---|---|---|
| (required) | File or directory to sign |
| (required) | DigiCert keypair alias for signing |
| SHA-256 | Digest algorithm (SHA-256, SHA-384, SHA-512) |
| true | Enable RFC 3161 timestamping |
| true | Stop on first error in bulk signing |
| false | Enable bulk signing for directories |
| false | Skip already signed files |
| false | Return exit code 0 even on signing failure |
| 0.0.0-0 | Cache version (change to force re-download) |
| https://pki-downloads.digicert.com/stm/latest | DigiCert CDN URL |
Get started with DigiCert Binary Signing for GitLab CI/CD
Use this section if you are setting up DigiCert Binary signing in GitLab CI/CD template for the first time. This procedure walks you through creating a new workflow and configuring the required credentials and inputs.
Upload your DigiCert client certificate (.p12 file) to GitLab Secure Files:
Navigate to your GitLab project.
Go to Settings > CI/CD >Secure Files.
Select Upload File and select your
.p12certificate.
Note
The template will automatically detect and use certificates having a .p12 extension.
Add your host, API key, and client certificate password to GitLab variables:
Navigate to your GitLab project.
Go to Settings > CI/CD >Variables .
In the Project variables section, select Add variable.
Add the following variables:
Variable | Descriptions | Required | Protected | Masked |
|---|---|---|---|---|
| DigiCert API host (e.g., https://clientauth.one.digicert.com) | Yes | Yes | No |
| Your DigiCert API key | Yes | Yes | Yes |
| Password for your | Yes | Yes | Yes |
| Path to certificate (use only if not using Secure Files) | No | Yes | No |
Note
Mark sensitive variables as protected and masked for security.
Add digicert-signing-template to your .gitlab-ci.yml
include: - remote: 'https://gitlab.com/<your-namespace>/digicert-signing-template/-/raw/main/templates/digicert-signing.yml'
For simple signing mode you must:
Specify the extend as
.simple-signing.Enter the variables;
KEYPAIR_ALIASandINPUT.
For traditional signing mode you must:
Specify the extend as
.traditional-signing.Use SMCTL or third-party tools signing commands for signing the files with your keypair alias.
Linux/macOS jobs
Linux/macOS templates:
.simple-signing- Simple signing without third-party tools (supports bulk signing)..traditional-signing- Traditional signing with PKCS#11 setup and more.
Note
To setup a GitLab runner, see https://docs.gitlab.com/runner/install/.
Windows templates
.simple-signing-windows- Simple signing for Windows (supports bulk signing of directories).traditional-signing-windows- Traditional signing with PKCS#11, KSP, and CSP and more (PowerShell)
Note
To setup a GitLab runner, see https://docs.gitlab.com/runner/install/.
Samples: Complete pipelines
Security Best Practices
Protect sensitive variables
Mark
SM_API_KEYandSM_CLIENT_CERT_PASSWORDas masked.Mark all signing variables as protected.
Use protected branches for production signing.
Secure certificate storage
Always use GitLab Secure Files for certificates.
Never commit certificates to Git repositories.
Rotate certificates before expiration.
Audit and logging
Review signing job logs regularly.
Monitor DigiCert console for signing activity.
Set up alerts for unusual activity.
Access control
Limit who can modify CI/CD variables.
Use protected branches for production pipelines.
Implement approval gates for deployments.
Troubleshooting
For common errors and solutions, see Troubleshooting chapter.