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
5
How to create your own CA Handler
grindsa edited this page 2021-05-09 06:42:25 +00:00
Table of Contents
How to create your own CA-Handler
Creating your own CA-handler should be pretty easy. All you need to do is to create your own ca_handler.py with a "CAhandler" class containing the following methods required by acme2certifier:
- enroll: to enroll a new certificate from CA server
- poll: to poll a pending certificate request from CA server
- revoke: to revoke an existing certificate on CA server
- trigger: to process trigger send by CA server
The skeleton_ca_handler.py contains a skeleton which can be used to create customized ca_handlers.
The below skeleton describes the different input parameters given by acme2certifier as well as the expected return values.
class CAhandler(object):
""" 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):
""" cose the connection at the end of the context """
def enroll(self, csr):
""" enroll certificate """
input:
csr - csr in pkcs10 format
output:
error - error message during cert enrollment (None in case no error occured)
cert_bundle - certificate chain in pem format
cert_raw - certificate in asn1 (binary) format - base64 encoded
poll_identifier - callback identifier to lookup enrollment request in case the CA server does not issue
certificate immediately. This identifier will be used by the polling method check if
a CSR got accepted
self.logger.debug('Certificate.enroll()')
...
self.logger.debug('Certificate.enroll() ended')
return(error, cert_bundle, cert_raw, poll_identifier)
def poll(self, cert_name, poll_identifier, _csr):
""" poll pending status of pending CSR and download certificates """
input:
cert_name - certificate ressource name
poll_identifier - poll identifier
csr - certificate signing request
output:
error - error message during cert polling (None in case no error occured)
cert_bundle - certificate chain in pem format
cert_raw - certificate in asn1 (binary) format - base64 encoded
poll_identifier - (updated) callback identifier - will be updated in database for later lookups
rejected - indicates of request has been rejected by CA admistrator - in case of a request rejection
the corresponding order status will be set to "invalid" state
self.logger.debug('CAhandler.poll()')
...
return(error, cert_bundle, cert_raw, poll_identifier, rejected)
def revoke(self, cert, rev_reason='unspecified', rev_date=uts_to_date_utc(uts_now())):
""" revoke certificate
input:
cert - certificate in pem format
reason - revocation reason
rev_date - revocation date
output:
code - http status code to be give back to the client
message - urn:ietf:params:acme:error:serverInternal in case of an error, None in case of no errors
detail - error details to be added to the client response """
self.logger.debug('CAhandler.revoke({0}: {1})'.format(rev_reason, rev_date))
...
self.logger.debug('Certificate.enroll() ended with: {0}, {1}, {2}'.format(code, message, detail))
return(code, message, detail)
def trigger(self, payload):
""" process trigger send by CA server """
input:
payload = payload content
output:
error - - error message (in case something went wrong)
cert_bundle - certificate chain in pem format
cert_raw - certificate in asn1 (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)
You can add additional methods according to your needs. You can also add configuration options to acme_srv.cfg allowing you to configure the ca_handler according to your needs.
Check the certifier_ca_handler.py especially the _config_load() method for further details.