mirror of
https://github.com/grindsa/acme2certifier.git
synced 2025-12-31 01:51:01 +02:00
Page:
How to Create Your Own CA Handler
Pages
# How to build an acme2certifier cluster on Ubuntu 22.04
<! wiki title: DEB Installation on Ubuntu 22.04
<! wiki title: External Account Binding
<! wiki title: Hooks
<! wiki title: Installation on Apache2 Running on Ubuntu 22.04
<! wiki title: Installation on NGINX Running on Alma Linux 9
<! wiki title: Pass Information from ACME Client to CA Handler
<! wiki title: Reporting and Housekeeping
<! wiki title: Support for ACME profiling
<! wiki title: Support for External Databases
ACME CA handler
Asynchronous Mode (`async_mode`) in acme2certifier
CA Handler for Microsoft Certification Authority Web Enrollment Service
CA Handler for Microsoft Windows Client Certificate Enrollment Protocol (MS WCCE)
CA Handler for NetGuard Certificate Lifecycle Manager
CA Handler for OpenXPKI
CA Handler for XCA
CA Handler for an OpenSSL based CA Stored on Local File System
CA Polling to Check Pending Enrollment Requests
CA Trigger
CA handler for Digicert CertCentral
CA handler for EJBCA
CA handler for Entrust ECS Enterprise
CA handler for Insta ActiveCMS
CA handler for Insta
CA handler for Microsoft Certification Authority Web Enrollment Service
CA handler for Microsoft Windows Client Certificate Enrollment Protocol (MS WCCE)
CA handler for NetGuard Certificate Lifecycle Manager
CA handler for NetGuard Certificate Manager and Insta Certifier
CA handler for OpenXPKI
CA handler for XCA
CA handler for an openssl based CA stored on local file system
CA handler using CMPv2 protocol
CA handler using EST protocol
CA polling to check pending enrollment requests
CA trigger
CA‐handler for Hashicorp Vault PKI
Configuration options for acme2certifier
Containerized Installation Using Apache2 or Nginx as Web Server with WSGI or Django
Containerized installation
DEB installation on Ubuntu 22.04
Database scheme
Enrollment of End User Certificates according to RFC8823
Enrollment profiling via external account binding
Example commands for acme clients
External Account Binding (EAB)
External Account Binding
Home
Hooks support
Hooks
How to Create Your Own CA Handler
How to build am acme2certifier cluster on Ubuntu 22.04
How to build an acme2certifier cluster on Alma Linux 9
How to build an acme2certifier cluster on Ubuntu 22.04
How to contribute to this project
How to create your own CA Handler
Installation on Apache2 Running on Ubuntu 22.04
Installation on NGINX Running on Alma Linux 9
Installation on Nginx Running on Ubuntu 22.04
Installation on nginx running on Ubuntu 22.04
Pass Information from ACME Client to CA Handler
Prevalidated Domain List Feature for ACME Authorization
Proxy Support in acme2certifier
Proxy support in acme2certifier
RPM Installation on AlmaLinux 9
RPM installation on Alma Linux 9
RPM installation on alma Linux 9
Reporting and Housekeeping support
SOAP CA Handler Prototype
SOAP CA handler protopype
Security Policy
Support for ACME profiling
Support for External Databases
Support for TNAuthList Identifier and tkauth 01 Challenges
Support for TNAuthList identifier and tkauth 01 challenges
Upgrading acme2certifier
Using cert manager to enroll certificate in Kubernetes environments
acme_srv.cfg configuration options
upgrading acme2certifier
vault
No results
2
How to Create Your Own CA Handler
grindsa edited this page 2025-06-27 15:44:18 +00:00
Table of Contents
How to Create Your Own CA Handler
Creating your own CA handler should be straightforward. All you need to do is create a ca_handler.py file with a CAhandler class that contains the following methods required by acme2certifier:
enroll: Enrolls a new certificate from the CA server.poll: Polls a pending certificate request from the CA server.revoke: Revokes an existing certificate on the CA server.trigger: Processes triggers sent by the CA server.
The skeleton_ca_handler.py file provides a template that you can use to create customized CA handlers.
The following skeleton outlines the input parameters received by acme2certifier, as well as the expected return values:
class CAhandler:
"""CA handler"""
def __init__(self, debug=None, logger=None):
"""
Input:
debug - Debug mode (True/False)
logger - Log handler
"""
self.debug = debug
self.logger = logger
def __enter__(self):
"""Makes CAhandler a context manager"""
return self
def __exit__(self, *args):
"""Closes the connection at the end of the context"""
pass
def enroll(self, csr):
"""Enrolls a certificate"""
# Input:
# csr - CSR in PKCS#10 format
# Output:
# error - Error message during certificate enrollment (None if no error occurred)
# cert_bundle - Certificate chain in PEM format
# cert_raw - Certificate in ASN.1 (binary) format, base64 encoded
# poll_identifier - Callback identifier to track enrollment requests when the CA server does not
# issue certificates immediately.
self.logger.debug("Certificate.enroll()")
...
self.logger.debug("Certificate.enroll() ended")
return None, None, None, None
def poll(self, cert_name, poll_identifier, csr):
"""Polls the status of a pending CSR and downloads certificates"""
# Input:
# cert_name - Certificate resource name
# poll_identifier - Poll identifier
# csr - Certificate Signing Request
# Output:
# error - Error message during certificate polling (None if no error occurred)
# cert_bundle - Certificate chain in PEM format
# cert_raw - Certificate in ASN.1 (binary) format, base64 encoded
# poll_identifier - Updated callback identifier for future lookups
# rejected - Indicates whether the request has been rejected by the CA administrator.
self.logger.debug("CAhandler.poll()")
...
return None, None, None, None, False
def revoke(self, cert, rev_reason="unspecified", rev_date=None):
"""Revokes a certificate"""
# Input:
# cert - Certificate in PEM format
# rev_reason - Revocation reason
# rev_date - Revocation date
# Output:
# code - HTTP status code to be returned to the client
# message - Error message if applicable, None otherwise
# detail - Additional error details
self.logger.debug(f"CAhandler.revoke({rev_reason}: {rev_date})")
...
return 200, None, None
def trigger(self, payload):
"""Processes triggers sent by the CA server"""
# Input:
# payload - Payload content
# Output:
# error - Error message (if something went wrong)
# cert_bundle - Certificate chain in PEM format
# cert_raw - Certificate in ASN.1 (binary) format, base64 encoded
self.logger.debug("CAhandler.trigger()")
...
self.logger.debug("CAhandler.trigger() ended with error: {0}".format(error))
return (error, cert_bundle, cert_raw)
Additional Customization
You can add additional methods as needed. Additionally, you can configure acme_srv.cfg to customize the behavior of the CA handler.
For further details, check certifier_ca_handler.py, especially the _config_load() method.