---
title: "Trusting in custom certificates"
description: "Trusting non-ICP-Brasil and Lacuna test certificates in PKI Express on PHP by configuring PkiExpressOperator and trustLacunaTestRoot."
canonical: "https://docs.lacunasoftware.com/en-us/articles/pki-express/php/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/PkiExpressPhp/blob/develop/src/PkiExpressOperator.php) 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 `trustLacunaTestRoot` field to `true` to trust in these certificates: 

```php
$operator->trustLacunaTestRoot = 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.

```php
$operator->addTrustedRoot('/path/to/root1.cer');
$operator->addTrustedRoot('/path/to/root2.cer');
$operator->addTrustedRoot('/path/to/root3.cer');
```
