Skip to content

4d-depot/TechNote_26-02_OpenSSL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Technical Note 26-02

OpenSSL in 4D using System Workers

By Al Mahdi Bakkali, Technical Support Engineer, 4D Inc.

Abstract

This document outlines the integration of OpenSSL within a 4D application environment to generate cryptographic assets using asynchronous execution patterns. This technical note leverages the 4D.SystemWorker class to enable non-blocking shell executions for generating Private Keys, Certificate Signing Requests (CSR), and self-signed certificates. The implementation demonstrates practical use cases including the production of signed XML documents for secure data exchange and the deployment of a 4D Web server configured with generated certificates. By adopting an asynchronous callback-based architecture, this integration ensures that cryptographic operations, which can be computationally intensive and time-consuming, do not interrupt the responsiveness of the user interface or block other application processes.

Introduction

In the modern landscape of digital security, the ability to generate, manage, and utilize cryptographic assets such as private keys, Certificate Signing Requests (CSR), and signed certificates and documents are no longer an optional feature; it is a fundamental requirement for compliance, e-invoicing, and secure data exchange. Organizations operating in regulated industries face strict mandates regarding data security and identity verification, making robust cryptographic infrastructure essential for business operations. Furthermore, the increasing prevalence of electronic invoicing systems and supply chain automation has created a need for developers to implement sophisticated digital signature mechanisms that can verify the authenticity and integrity of transmitted data.

This document serves as a comprehensive technical manual for integrating OpenSSL within the 4D development environment using the 4D.SystemWorker class. By moving away from legacy synchronous execution patterns with LAUNCH EXTERNAL PROCESS that block application threads and embracing the asynchronous capabilities of System Workers, developers can build responsive, high-performance applications that interact directly with the operating system's command-line interface. The asynchronous approach represents a significant architectural evolution, allowing cryptographic operations to execute in the background while the main application thread remains available to process user interactions and handle other concurrent tasks. This transition from blocking to non-blocking execution is particularly important for applications that must maintain responsiveness during certificate generation, which can take several seconds or even minutes depending on key size and system resources.

Please read the full Tech Note as PDF


OpenSSL Integration for 4D

A 4D application that integrates OpenSSL to generate and manage cryptographic assets using asynchronous, non-blocking execution via 4D.SystemWorker.

Features

  • Generate Private Keys, CSRs, and self-signed certificates
  • Produce signed XML documents for secure data exchange
  • Deploy a 4D Web Server configured with generated certificates
  • Cross-platform support (Windows & macOS)
  • Non-blocking UI during cryptographic operations

Requirements

  • 4D 21 LTS
  • OpenSSL 3.0 or later
  • Windows 11 or macOS Tahoe 26 (Apple Silicon)

Installing OpenSSL

Windows

winget install openssl

macOS

brew install openssl

OpenSSL Path

The app auto-detects the OpenSSL binary on startup. If your installation is in a non-standard location, you can manually specify the path in the app settings — it will be stored for all subsequent operations.

About

This technical note leverages the 4D.SystemWorker class to enable non-blocking shell executions for generating Private Keys, Certificate Signing Requests (CSR), and self-signed certificates.

Topics

Resources

License

Stars

Watchers

Forks

Contributors