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

Pipeline Script

  • Pipeline Definition: Defines the overall pipeline structure (e.g., pipeline { ... }).
  • Stage: Groups related steps into logical phases (e.g., stage('Build') { ... }).
  • Condition (Optional): Controls execution based on certain criteria (e.g., when { expression }).
  • Error Handling (Optional): Manages unexpected situations during pipeline execution.
  • Shared Resource (Optional): Reusable component (function/library) for multiple pipelines.

    Pipeline Script

    A sample script for Jenkins project is provided below.

                                        
                                            pipeline {
                                                agent any
                                                parameters {
                                                    string(name: 'BRANCH_NAME', defaultValue: 'main', description: 'Branch to build')
                                                }
                                                stages {
                                                    stage('Checkout') {
                                                        steps {
                                                            script {
                                                                // Checks out the existence of the specified branch in the repository
                                                                checkout([$class: 'GitSCM', branches: [[name: params.BRANCH_NAME]], userRemoteConfigs: [[url: 'https://github.com/shivamSharmaMWP/reproducible_dotnet.git', credentialsId: 'shivamSharmaMWP']]])
                                                            }
                                                        }
                                                    }
                                             
                                                    stage('Build') {
                                                        steps {
                                                        // Provide the build command according to source code language
                                                            bat 'dotnet build'
                                                        // Archive the unique versions of the specified file
                                                            archiveArtifacts artifacts: 'bin/Debug/net7.0/reproducible_dotnet.exe', fingerprint: true
                                                        }
                                                    }
                                                    
                                                    stage('Sign') {
                                                        steps {
                                                        // Provide extra Signing Project Parameters – required for this setup
                                                            bat "echo {\"codesign_signing_project_id\": 2, \"codesign_build_job_id\": ${env.BUILD_NUMBER}} > signing_parameters.json"
                                                        // Provide Signing command 
                                                            bat 'set EC_SIGN_PARAMS=.\\signing_parameters.json && signtool sign /csp "Encryption Consulting Key Storage Provider" /kc onetech /fd SHA256 /f c:/websites/onetech.crt /tr http://timestamp.digicert.com /td SHA256 bin/Debug/net7.0/reproducible_dotnet.exe'
                                                     // Archive the unique versions of the specified file
                                                            archiveArtifacts artifacts: 'bin/Debug/net7.0/reproducible_dotnet.exe', fingerprint: true
                                                        }
                                                    }
                                                }
                                            }                                
                                        
                                    
  • Save the configuration for the pipeline. This will create a build project on Jenkins server.

    Build Project

    Jenkins Project is configured in such a way that every build job must contain a commit that it uses to pull the specific version of source code.

    Project Configuration

    You can adjust your pipeline so that whenever a new commit is made to the source code in the repository, it should trigger a new build started on the Jenkins server for that specific commit, like above.

To access reproducible build functionality from the CodeSignSecure Server

  • A signing project must be added with the source code repository details
  • Provide the build commands
  • Add the Build server (Jenkins) project details
  • Add the email to receive signing status notifications

To add a Signing Project on CodeSignSecure server:

  • Go to the System setup tab and click on Signing Projects

    Signing Projects

  • Click on add Signing Project. An input form will open to take the required details of the project

    Signing Projects Form

  • Project Name: Corresponds to the name of the Project that you want to use Hash verification for.
  • Source Code Management: As per best industry standards, we're supporting GitHub for now.
  • Git Repository URL: Corresponds to the URL of your configured repository.
  • Git Username: Corresponds to the username for logging into your git.
  • Git Token: Corresponds to the access token for logging into your git.
  • Git Allowed Branches (Optional): Corresponds to specific branches from which the builds will be accessed.
  • Environmental Variables: Corresponds to any variables required for the project.
  • Build Command: Corresponds to the command that will be used to create the build files from repository.
  • Build File Path: Corresponds to the location to store the created build file.
  • Build Server: As per best industry standards, we're supporting Jenkins for now.
  • Build Signer Type: As per industry standards, we're supporting SignTool with KSP and JarSigner with KSP tools.
  • Jenkins Project URL: Corresponds to the URL of the Jenkins project that you have created for the pipeline.
  • Jenkins Username: Corresponds to your username to access the Jenkins server and project.
  • Jenkins Password: Corresponds to your password to access the Jenkins server and project.
  • Email Recipient: Corresponds to your email to get notified regarding the status of Code Signing.

After providing the build settings, the project will be created, and details can be overviewed by selecting the specific project.

Signing Project Details

Now, use the Certificate or Key from CodeSignSecure keys list required for signing the code.

  • To create a new Key and Certificate, go to the Keys and Certificates tab on CodeSignSecure and click on Add new Certificate

    Keys and Certificates Rout

  • Provide the details regarding the Key & Certificate creation in the input form.

    Certificate Form

  • Reproducible Build Key Usage: This tells whether the key will be used for Pre-Sign Hash Validation or Post-Sign Hash Validation or none of these. This is required for the Hash validation of the latest build and verify the origin of the file.

    To see the details about a specific key & certificate, click on the respective certificate's UID.

    Key and Certificate Detail

    With this setup, whenever you submit the signing request via Signtool, it will automatically pass extra parameters of the Signing Project ID and Build Job ID within the signing request.

    It fetches commit revision and build job ID at code signing time. If parameters are not correct in this process, code signing will be declined

On this Page:
Support Privacy Policy Terms of Service

Copyright Encryption Consulting LLC. All rights reserved.