Skip to content

[18.0][ADD] certificate_data_encryption: add module - #294

Draft
rvalyi wants to merge 1 commit into
OCA:18.0from
akretion:18.0-add-certificate_data_encryption
Draft

[18.0][ADD] certificate_data_encryption: add module#294
rvalyi wants to merge 1 commit into
OCA:18.0from
akretion:18.0-add-certificate_data_encryption

Conversation

@rvalyi

@rvalyi rvalyi commented Sep 3, 2026

Copy link
Copy Markdown
Member

assisted by glm-5.3

This module allows to store the passwords of the certificates and private keys managed by the core certificate module in an encrypted and per environment way (dev, staging, production), instead of clear text in the database.

It connects the core certificate module with the OCA server-env encryption mechanism (server_environment_data_encryption and data_encryption): the passwords become environment managed fields (server.env.mixin) whose values are stored encrypted in the encrypted.data table using a Fernet key per environment.

Covered fields:

  • certificate.certificate.pkcs12_password
  • certificate.key.password

Follow the configuration of the server_environment and server_environment_data_encryption modules:

  • define running_env in the Odoo configuration file;

  • define one Fernet key per environment in the [options] section, e.g. encryption_key_prod = ZZZ;

  • generate the keys with: python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key())'.

The passwords are no longer stored in the certificate.certificate and certificate.key tables: they are set/changed from the forms (the screen shows which environment is being edited) and are stored encrypted in the encrypted.data table, per environment.

If no encryption key is configured for the current environment, the module has no effect (default behavior of
server_environment_data_encryption).

@OCA-git-bot OCA-git-bot added series:18.0 mod:certificate_data_encryption Module certificate_data_encryption labels Sep 3, 2026
@rvalyi
rvalyi force-pushed the 18.0-add-certificate_data_encryption branch from 6386eec to 8942969 Compare September 3, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:certificate_data_encryption Module certificate_data_encryption series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants