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

# Pkcs7CertificateStore

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

```csharp
public class Pkcs7CertificateStore : ICertificateStore
```

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

## Propriedades

### `Certificates`

```csharp
public List<PKCertificate> Certificates { get; }
```

**Retorno**

[`List<PKCertificate>`](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)

---

## Métodos

### `Decode(byte[])`

Decodes a PKCS#7 certificate store

```csharp
public static Pkcs7CertificateStore Decode(byte[] content)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `content` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) | The BER/DER or PEM encoded PKCS#7 content |

**Retorno**

[`Pkcs7CertificateStore`](https://docs.lacunasoftware.com/api/Lacuna.Pki.Stores/Pkcs7CertificateStore)

---

### `Decode(string)`

Decodes a PKCS#7 certificate store

```csharp
public static Pkcs7CertificateStore Decode(string content)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `content` | [`string`](https://learn.microsoft.com/dotnet/api/system.string) | The PEM encoded or Base64 encoded PKCS#7 string |

**Retorno**

[`Pkcs7CertificateStore`](https://docs.lacunasoftware.com/api/Lacuna.Pki.Stores/Pkcs7CertificateStore)

---

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

Encodes a certificate list as DER PKCS#7 certificate store

```csharp
public static byte[] Encode(IEnumerable<PKCertificate> certificates)
```

**Parâmetros**

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

**Retorno**

[`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) — PKC#7 certificate store DER encoded bytes

---

### `GetCertificate(byte[])`

Find a certificate by its Key Identifier

```csharp
public PKCertificate GetCertificate(byte[] keyIdentifier)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `keyIdentifier` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |

**Retorno**

[`PKCertificate`](https://docs.lacunasoftware.com/api/Lacuna.Pki/PKCertificate)

---

### `GetCertificate(Name, BigInteger)`

Find a certificate by its Issuer Name and Serial Number

```csharp
public PKCertificate GetCertificate(Name issuerName, BigInteger serialNumber)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `issuerName` | [`Name`](https://docs.lacunasoftware.com/api/Lacuna.Pki/Name) | Certificate's issuer name |
| `serialNumber` | [`BigInteger`](https://learn.microsoft.com/dotnet/api/system.numerics.biginteger) | Certificate's serial number |

**Retorno**

[`PKCertificate`](https://docs.lacunasoftware.com/api/Lacuna.Pki/PKCertificate)

---

### `GetCertificates(Name)`

Find one or more certificates by its Subject Name

```csharp
public List<PKCertificate> GetCertificates(Name subjectName)
```

**Parâmetros**

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

**Retorno**

[`List<PKCertificate>`](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)

---

## 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)
