Package: certomancer
CertomancerQuickly construct, mock & deploy PKI test configurations using simple declarative configuration.
Includes CRL, OCSP and time stamping service provisioning.Requires Python 3.7 or later.Quick startCertomancer isavailable on PyPI. Seeexample.ymlfor an example config file.$pipinstall'certomancer[web-api,pkcs12]'$certomancer--configexample.ymlanimateThis will run the Certomancer Animator WSGI app on your local machine, behind a development web
server. Point your browser tohttp://localhost:9000and take a look around.
For more information, see thedocumentationbelow.Installing the development versionTo build and install an (unreleased) development version, you can proceed as follows.$gitclonehttps://github.com/MatthiasValvekens/certomancer
$cdcertomancer
$python-mbuild
$pipinstalldist/certomancer*.whlDemoThere's a demo on asciinema.org, demonstrating some of the core features of Certomancer. See link below.FOSDEM '22 talkI gave a lightning talk on testing & mocking PKI services in theTesting & Automation devroomatFOSDEM 2022. Certomancer was (of course) featured in the presentation.
If you want to learn more, or watch the recording, have a look atthe talk pagefor further info. Slides are included as well.FeaturesCertomancer's core APIs are stateless: the same request should always return the same result.
This property makes it very useful for automated testing.Note that "the same result" does not necessarily mean "byte-for-byte equal".
This is because some signing schemes (like ECDSA) involve random nonces. In addition to that,
time is also a factor in certain cases (but Certomancer does permit time manipulation).Declarative, YAML-based configuration.Minimal input validation, so you can generate deliberately broken certificates if you need to.requests-mockintegration.Attribute certificate support (0.7.0and up)Ultra-lightweight WSGI application: the Certomancer Animator serves CRLs, OCSP responses,
timestamps and more. This component requires Werkzeug, and optionally Jinja2 for the index view.
Other than a web server and WSGI application server, there are no application dependencies.Plugin framework to support arbitrary certificate / CRL extensions and additional services.
These plugins are compatible with the WSGI andrequests-mockintegrations without
additional configuration.Certomancer is composable: since the Certomancer Animator is a bare-bones WSGI application,
you can plug it into whatever web application framework you want with minimal overhead.
Hence, for particularly complicated scenarios where the plugin API or existing integrations aren't
sufficient, it is very easy to use Certomancer as a library, or wrap it as a component
of some other WSGI application.Withpyca/cryptographyinstalled, Certomancer can also
output PKCS#12 files if your tests require those.Withpython-pkcs11installed, Certomancer can write
keys and certificates to PKCS#11 tokens as well.Non-featuresCertomancer is a testing tool for developers that write software to interface with public-key
infrastructure.It isNOTintended to be used to manage production PKI deployments.Certomancer is very much garbage-in garbage-out, and happily ignores validation &
security best practices in favour of allowing you to abuse your codebase in the worst possible ways.
Consider yourself warned.DocumentationConfigurationCLI commandsPlugin APIDeploying Certomancer