---
title: "Trusting in custom certificates"
description: "Trusting non-ICP-Brasil and Lacuna test certificates in PKI Express on Python by configuring PkiExpressOperator and trust_lacuna_test_root."
canonical: "https://docs.lacunasoftware.com/en-us/articles/pki-express/python/trusting-in-custom-certificates"
locale: "en"
product: "PKI Express"
last_updated: "2026-10-12"
---

# Trusting in custom certificates

By default, PKI Express will only allow operations performed by valid Brazilian certificates emmited by ICP-Brasil organization. However, if you want to use another kind of the certificate, it's required to configure the [PkiExpressOperator](https://github.com/LacunaSoftware/PkiExpressPython/blob/develop/pkiexpress/pki_express_operator.py) class or **any class that inherits from it**.

## Using Lacuna's testing certificates
In case you are testing your aplication using our mock certificates (see [test certificates](https://docs.lacunasoftware.com/en-us/articles/pki-guide/test-certs)), you have to set the `trust_lacuna_test_root` field to `True` to trust in these certificates: 

```python
operator.trust_lacuna_test_root = True
```

## Using a custom certificate
In case you are using other kinds of certificates, you need to provide each certificate roots for the operator class.

```python
operator.add_trusted_root('/path/to/root1.cer')
operator.add_trusted_root('/path/to/root2.cer')
operator.add_trusted_root('/path/to/root3.cer')
```
