How to install a Code Signing Certificate from a Developer
Code signing certificates in Niagara 4 provide security and trust verification for modules, applications, and custom code. Installing a developer's code signing certificate allows you to trust and execute signed code from that developer in your Station.
Overview
Code signing certificates serve several purposes:
- Code Integrity: Verify code hasn't been tampered with
- Developer Authentication: Verify code origin
- Trust Management: Control which developers' code can execute
- Security Policy: Enforce security policies for code execution
Prerequisites
Before installing a code signing certificate, ensure you have:
- Administrative access to the Niagara Station
- The code signing certificate file from the developer
- Certificate file format information (typically .cer, .crt, or .p7b)
- Understanding of your Station's code signing policy
Understanding Code Signing in Niagara
How Code Signing Works
- Developer Signs Code: Developer signs module/code with their certificate
- Certificate Verification: Station verifies certificate validity
- Trust Check: Station checks if certificate is trusted
- Code Execution: If trusted, code executes; otherwise, execution may be blocked
Certificate Types
- Developer Certificate: Certificate from individual developer
- CA Certificate: Certificate Authority certificate (trusts all certificates from that CA)
- Root Certificate: Root CA certificate (trusts entire certificate chain)
Step-by-Step Installation
Step 1: Obtain Certificate from Developer
Request the code signing certificate from the developer:
- Certificate File: Obtain certificate file (.cer, .crt, .p7b, or .pem format)
- Certificate Chain: If provided, obtain full certificate chain
- Certificate Information: Request certificate details (issuer, validity period)
- Verification: Verify certificate authenticity with developer
Step 2: Access Certificate Store
- Open Niagara Workbench
- Connect to your target Station
- Navigate to Station → Properties
- Go to Security or Certificates tab
- Locate Code Signing Certificates or Trusted Certificates section
Alternatively:
- Navigate to Services → Security Service (if available)
- Access Certificates or Code Signing section
Step 3: Import Certificate
- In the Certificates section, click Import or Add Certificate
- Select Import from File option
- Browse to the certificate file location
- Select the certificate file
- Click Open to begin import
Step 4: Configure Certificate Properties
During import, configure certificate properties:
- Certificate Name: Enter descriptive name (e.g., "Developer Name - Code Signing")
- Certificate Purpose: Select "Code Signing" or "Trust"
- Trust Level: Set trust level (Full Trust, Limited Trust, etc.)
- Validity Period: Review certificate validity dates
- Certificate Details: Review certificate information (issuer, subject, etc.)
Step 5: Verify Certificate Information
Review imported certificate details:
- Subject: Certificate owner information
- Issuer: Certificate Authority information
- Validity: Certificate validity period
- Thumbprint: Certificate unique identifier
- Key Usage: Certificate intended uses
Step 6: Install Certificate Chain (if provided)
If developer provided certificate chain:
- Import root CA certificate first
- Import intermediate CA certificates
- Import developer certificate last
- Verify certificate chain is complete
Step 7: Configure Trust Settings
Set trust configuration for the certificate:
- Trust for Code Signing: Enable trust for code signing
- Trust for Authentication: Configure authentication trust (if applicable)
- Trust Scope: Set trust scope (Station-wide, specific applications, etc.)
- Auto-Trust: Configure automatic trust for certificates from this issuer
Step 8: Verify Certificate Installation
- Certificate List: Verify certificate appears in trusted certificates list
- Certificate Status: Check certificate status (Valid, Expired, etc.)
- Trust Status: Verify trust settings are configured correctly
- Test Signed Code: Test with signed code from developer
Step 9: Configure Code Signing Policy
Configure Station code signing policy:
- Navigate to Station → Properties → Security
- Locate Code Signing Policy section
- Configure policy:
- Require Signing: Require all code to be signed
- Allow Unsigned: Allow unsigned code (not recommended)
- Trusted Developers: List of trusted developers/certificates
- Blocked Certificates: List of blocked/revoked certificates
Step 10: Test Certificate Functionality
- Obtain Signed Module: Request signed test module from developer
- Import Module: Import signed module into Station
- Verify Signature: Verify module signature is recognised
- Execute Module: Test module execution
- Review Logs: Check logs for certificate-related messages
Certificate File Formats
Common Formats
- .cer / .crt: DER or PEM encoded certificate
- .p7b / .p7c: PKCS#7 certificate chain
- .pem: PEM encoded certificate (text format)
- .pfx / .p12: PKCS#12 certificate with private key (not typically used for trust)
Format Conversion
If certificate format needs conversion:
- Use OpenSSL: Convert between formats using OpenSSL
- Certificate Tools: Use Windows Certificate Manager or similar tools
- Developer Assistance: Request certificate in required format from developer
Configuration Examples
Basic Certificate Installation
Certificate File: developer-code-signing.cer
Certificate Name: Acme Developers - Code Signing
Trust Level: Full Trust
Purpose: Code Signing
Validity: 2024-01-01 to 2025-12-31
Certificate Chain Installation
Root CA: root-ca.cer
Intermediate CA: intermediate-ca.cer
Developer Cert: developer-cert.cer
Installation Order: Root → Intermediate → Developer
Troubleshooting
Certificate Import Failures
If certificate import fails:
- File Format: Verify certificate file format is supported
- File Corruption: Check certificate file is not corrupted
- Permissions: Ensure you have administrative permissions
- File Path: Verify file path is accessible
- Format Conversion: Try converting to different format
Certificate Not Trusted
If certificate is not trusted:
- Trust Settings: Verify trust settings are configured
- Certificate Chain: Ensure full certificate chain is installed
- Root CA: Verify root CA certificate is trusted
- Certificate Status: Check certificate is not expired or revoked
- Policy Configuration: Review code signing policy settings
Signed Code Not Executing
If signed code is not executing:
- Certificate Trust: Verify certificate is in trusted list
- Code Signature: Verify code is properly signed
- Policy Settings: Check code signing policy allows execution
- Certificate Validity: Verify certificate is within validity period
- Logs: Review Station logs for specific error messages
Certificate Expiration
When certificate expires:
- Renewal: Request renewed certificate from developer
- Update Certificate: Replace expired certificate with new one
- Validity Monitoring: Set up monitoring for certificate expiration
- Notification: Configure alerts for upcoming expirations
Security Best Practices
Certificate Management
- Verification: Always verify certificate authenticity with developer
- Secure Storage: Store certificates securely
- Regular Review: Periodically review trusted certificates
- Revocation: Remove revoked or compromised certificates immediately
Trust Configuration
- Principle of Least Privilege: Only trust necessary certificates
- Specific Trust: Trust specific developers rather than entire CAs when possible
- Regular Audits: Periodically audit trusted certificates
- Documentation: Document why each certificate is trusted
Policy Enforcement
- Require Signing: Require code signing for all custom code
- Block Unsigned: Block execution of unsigned code
- Monitor Execution: Monitor code execution and certificate usage
- Incident Response: Have process for handling certificate issues
Advanced Configuration
Certificate Revocation Lists (CRL)
Configure CRL checking:
- CRL Location: Configure CRL distribution point
- CRL Updates: Set up automatic CRL updates
- Revocation Checking: Enable revocation checking for certificates
- Offline CRL: Configure offline CRL if network access is limited
Certificate Pinning
For enhanced security:
- Pin Certificates: Pin specific certificates for critical applications
- Certificate Validation: Configure strict certificate validation
- Chain Validation: Require full certificate chain validation
- OCSP: Configure Online Certificate Status Protocol checking
Integration with PKI
Integrate with enterprise PKI:
- Enterprise CA: Trust enterprise Certificate Authority
- Auto-Enrollment: Configure automatic certificate enrollment
- Group Policy: Apply certificate policies via group policy
- Centralised Management: Use centralised certificate management tools
Related Topics
- How to set two-factor authentication in a Niagara Station (Gauth)
- How to setup LDAP integration in a Niagara Station
Additional Resources
- Code Signing Best Practices
- X.509 Certificate Standards (RFC 5280)
- Niagara 4 Security Guide
- Public Key Infrastructure (PKI) Documentation