---
title: "TrustedRoots"
description: "Namespace: Lacuna.Pki"
canonical: "https://docs.lacunasoftware.com/api/Lacuna.Pki/TrustedRoots"
locale: "pt-BR"
product: "PKI SDK"
last_updated: "2026-06-02"
---

# TrustedRoots

**Namespace:** `Lacuna.Pki`  
**Assembly:** `Lacuna.Pki`  
_Class_

```csharp
public class TrustedRoots : ITrustArbitrator
```

**Hierarquia:** [`object`](https://learn.microsoft.com/dotnet/api/system.object) → `TrustedRoots`

## Construtores

### `TrustedRoots()`

```csharp
public TrustedRoots()
```

---

### `TrustedRoots(IEnumerable<PKCertificate>, IEnumerable<PKCertificate>)`

```csharp
public TrustedRoots(IEnumerable<PKCertificate> trustedRoots, IEnumerable<PKCertificate> intermediateCAs)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `trustedRoots` | [`IEnumerable<PKCertificate>`](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) |  |
| `intermediateCAs` | [`IEnumerable<PKCertificate>`](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) |  |

---

### `TrustedRoots(IEnumerable<PKCertificate>)`

```csharp
public TrustedRoots(IEnumerable<PKCertificate> trustedRoots)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `trustedRoots` | [`IEnumerable<PKCertificate>`](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) |  |

---

### `TrustedRoots(params PKCertificate[])`

```csharp
public TrustedRoots(params PKCertificate[] trustedRoots)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `trustedRoots` | `PKCertificate[]` |  |

---

## Métodos

### `Add(PKCertificate)`

```csharp
public void Add(PKCertificate trustedRoot)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `trustedRoot` | [`PKCertificate`](https://docs.lacunasoftware.com/api/Lacuna.Pki/PKCertificate) |  |

---

### `AddIntermediateCAs(IEnumerable<PKCertificate>)`

```csharp
public void AddIntermediateCAs(IEnumerable<PKCertificate> intermediateCAs)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `intermediateCAs` | [`IEnumerable<PKCertificate>`](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) |  |

---

### `AddRange(IEnumerable<PKCertificate>)`

```csharp
public void AddRange(IEnumerable<PKCertificate> trustedRoots)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `trustedRoots` | [`IEnumerable<PKCertificate>`](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) |  |

---

### `GetCertificateStore()`

Returns a certificate store based on the arbitrator root certificates

```csharp
public ICertificateStore GetCertificateStore()
```

**Retorno**

[`ICertificateStore`](https://docs.lacunasoftware.com/api/Lacuna.Pki.Stores/ICertificateStore) — Certificate store based on the arbitrator root certificates. Can be null.

**Comentários**

If that method does not make sense for your implementation or there is
            no certificate in your arbitrator logic, it can return null.

---

### `IsRootTrusted(PKCertificate, DateTimeOffset?, out ValidationResults)`

Determines whether a given PKCertificate is trusted, optionally outputting a ValidationResults object
that represents validations done while asserting the trust status.

```csharp
public bool IsRootTrusted(PKCertificate root, DateTimeOffset? dateReference, out ValidationResults vr)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `root` | [`PKCertificate`](https://docs.lacunasoftware.com/api/Lacuna.Pki/PKCertificate) | The certificate for which the trust status must be determined. |
| `dateReference` | [`DateTimeOffset?`](https://learn.microsoft.com/dotnet/api/system.datetimeoffset) | An optional date reference on which the trust is to be asserted. If null, validation is done considering the present moment (now). |
| `vr` | [`ValidationResults`](https://docs.lacunasoftware.com/api/Lacuna.Pki/ValidationResults) | The retults of the validations necessary to assertain the trust status. Implementors of this interface should set this parameter to null             if no validations where required. |

**Retorno**

[`bool`](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether the given certificate is to be trusted or not.

---

## Membros herdados

[`ToString()`](https://learn.microsoft.com/dotnet/api/system.object.tostring), [`Equals(object)`](<https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)>), [`Equals(object, object)`](<https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)>), [`ReferenceEquals(object, object)`](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [`GetHashCode()`](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [`GetType()`](https://learn.microsoft.com/dotnet/api/system.object.gettype), [`MemberwiseClone()`](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)
