This guide will help you set up code signing for your Log Viewer application to meet Microsoft Store Policy 10.2.9 requirements. All apps submitted to the Microsoft Store must be digitally signed with SHA256 or higher code signing certificates.
Requirement: “Your app must be digitally signed as per this policy with a SHA256 or higher code sign certificate.”
What this means:
Pros:
Setup Steps:
Pros:
Cons:
# Install Azure CLI
# Sign in to Azure
az login
# Create Trusted Signing account (replace with your values)
az trustedsigning account create \
--resource-group myResourceGroup \
--account-name myTrustedSigningAccount \
--location "East US"
# Create signing identity
az trustedsigning identity create \
--account-name myTrustedSigningAccount \
--resource-group myResourceGroup \
--identity-name mySigningIdentity \
--subject-name "CN=Michette Technologies"
# If using a PFX file
set CODESIGN_PFX_FILE=C:\path\to\MichetteTech.pfx
set CODESIGN_PASSWORD=your_certificate_password
# If certificate is in Windows Certificate Store
set CODESIGN_IDENTITY="Michette Technologies"
Create a batch file setup_codesigning.bat:
@echo off
REM Code Signing Configuration for Log Viewer
REM Author: travis@michettetech.com
echo Setting up code signing environment...
REM Method 1: Using PFX file
REM set CODESIGN_PFX_FILE=C:\certificates\MichetteTech.pfx
REM set CODESIGN_PASSWORD=your_password_here
REM Method 2: Using Certificate Store (recommended)
set CODESIGN_IDENTITY=Michette Technologies
REM Timestamp server (required for long-term validity)
set CODESIGN_TIMESTAMP=http://timestamp.digicert.com
REM Alternative timestamp servers (use any one):
REM set CODESIGN_TIMESTAMP=http://timestamp.sectigo.com
REM set CODESIGN_TIMESTAMP=http://timestamp.entrust.net/TSS/RFC3161sha2TS
echo Code signing configured!
echo Identity: %CODESIGN_IDENTITY%
echo Timestamp: %CODESIGN_TIMESTAMP%
REM Test certificate access
if defined CODESIGN_PFX_FILE (
if exist "%CODESIGN_PFX_FILE%" (
echo ✓ PFX file found: %CODESIGN_PFX_FILE%
) else (
echo ✗ PFX file not found: %CODESIGN_PFX_FILE%
)
) else (
REM Test certificate store access
certlm.msc /s >nul 2>&1
if %errorlevel% equ 0 (
echo ✓ Certificate store accessible
) else (
echo ⚠ Run as administrator to access certificate store
)
)
# Set up environment
call setup_codesigning.bat
# Build the application
cd rpmbuild/SOURCES
Build_App_Windows.bat
# Basic verification
signtool verify /pa LogViewer-3.3.0.exe
# Detailed verification
signtool verify /pa /v LogViewer-3.3.0.exe
# Show all certificate details
signtool verify /pa /v /all LogViewer-3.3.0.exe
Cause: Certificate not found or accessible
Solutions:
# List available certificates
certlm.msc
# Or via command line
powershell -Command "Get-ChildItem -Path Cert:\CurrentUser\My"
powershell -Command "Get-ChildItem -Path Cert:\LocalMachine\My"
# Check exact certificate subject name
powershell -Command "Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object {$_.Subject -like '*Michette*'}"
Cause: Incorrect password or corrupted PFX file
Solutions:
# Test PFX file access
certutil -dump "path\to\certificate.pfx"
# Verify password
openssl pkcs12 -info -in certificate.pfx -noout
Cause: Network issues or timestamp server unavailable
Solutions:
# Try alternative timestamp servers
set CODESIGN_TIMESTAMP=http://timestamp.sectigo.com
set CODESIGN_TIMESTAMP=http://timestamp.entrust.net/TSS/RFC3161sha2TS
set CODESIGN_TIMESTAMP=http://timestamp.globalsign.com/tsa/r6advanced1
# Test network connectivity
ping timestamp.digicert.com
# Check certificate expiration
powershell -Command "Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object {$_.Subject -like '*Michette*'} | Select-Object Subject, NotAfter"
# Verify certificate chain
signtool verify /pa /v /all LogViewer-3.3.0.exe | findstr "Chain"
name: Build and Sign Windows
on:
push:
tags: ['v*']
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install PyInstaller
- name: Set up code signing
env:
CODESIGN_IDENTITY: $
CODESIGN_PASSWORD: $
CODESIGN_TIMESTAMP: $
run: |
echo "Code signing configured"
- name: Build and sign executable
env:
CODESIGN_IDENTITY: $
CODESIGN_PASSWORD: $
CODESIGN_TIMESTAMP: $
run: |
cd rpmbuild/SOURCES
Build_App_Windows.bat
- name: Verify signature
run: |
signtool verify /pa rpmbuild/SOURCES/LogViewer-*.exe
| Option | Initial Cost | Annual Cost | Hardware Required | Best For |
|---|---|---|---|---|
| Microsoft Trusted Signing | $0 | ~$108/year | None | CI/CD, Cloud-first |
| Standard Certificate | $200-300 | $200-300 | None | Basic signing |
| EV Certificate | $300-500 | $300-500 | Hardware token | Instant reputation |
http://timestamp.digicert.comhttp://timestamp.sectigo.comhttp://timestamp.entrust.net/TSS/RFC3161sha2TShttp://timestamp.globalsign.com/tsa/r6advanced1signtool verify /paNeed Help?