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

# Authentication

**Namespace:** `Lacuna.RestPki.Client`  
**Assembly:** `Lacuna.RestPki.Client`  
_Class_

```csharp
public class Authentication
```

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

## Construtores

### `Authentication(RestPkiClient)`

```csharp
public Authentication(RestPkiClient client)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `client` | [`RestPkiClient`](https://docs.lacunasoftware.com/api/Lacuna.RestPki.Client/RestPkiClient) |  |

---

## Métodos

### `Complete(byte[], byte[], byte[], AuthenticationOptions)`

```csharp
public ValidationResults Complete(byte[] nonce, byte[] certificateContent, byte[] signature, AuthenticationOptions options)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `nonce` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `certificateContent` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `signature` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `options` | [`AuthenticationOptions`](https://docs.lacunasoftware.com/api/Lacuna.RestPki.Client/AuthenticationOptions) |  |

**Retorno**

[`ValidationResults`](https://docs.lacunasoftware.com/api/Lacuna.RestPki.Client/ValidationResults)

---

### `Complete(byte[], byte[], byte[], Guid)`

```csharp
public ValidationResults Complete(byte[] nonce, byte[] certificateContent, byte[] signature, Guid securityContextId)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `nonce` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `certificateContent` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `signature` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `securityContextId` | [`Guid`](https://learn.microsoft.com/dotnet/api/system.guid) |  |

**Retorno**

[`ValidationResults`](https://docs.lacunasoftware.com/api/Lacuna.RestPki.Client/ValidationResults)

---

### `CompleteAsync(byte[], byte[], byte[], AuthenticationOptions)`

```csharp
public Task<ValidationResults> CompleteAsync(byte[] nonce, byte[] certificateContent, byte[] signature, AuthenticationOptions options)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `nonce` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `certificateContent` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `signature` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `options` | [`AuthenticationOptions`](https://docs.lacunasoftware.com/api/Lacuna.RestPki.Client/AuthenticationOptions) |  |

**Retorno**

[`Task<ValidationResults>`](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)

---

### `CompleteAsync(byte[], byte[], byte[], Guid)`

```csharp
public Task<ValidationResults> CompleteAsync(byte[] nonce, byte[] certificateContent, byte[] signature, Guid securityContextId)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `nonce` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `certificateContent` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `signature` | [`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte) |  |
| `securityContextId` | [`Guid`](https://learn.microsoft.com/dotnet/api/system.guid) |  |

**Retorno**

[`Task<ValidationResults>`](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)

---

### `CompleteWithWebPki(string)`

```csharp
public ValidationResults CompleteWithWebPki(string token)
```

**Parâmetros**

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

**Retorno**

[`ValidationResults`](https://docs.lacunasoftware.com/api/Lacuna.RestPki.Client/ValidationResults)

---

### `CompleteWithWebPkiAsync(string)`

```csharp
public Task<ValidationResults> CompleteWithWebPkiAsync(string token)
```

**Parâmetros**

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

**Retorno**

[`Task<ValidationResults>`](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)

---

### `GetCertificate()`

```csharp
public PKCertificate GetCertificate()
```

**Retorno**

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

---

### `Start()`

```csharp
public byte[] Start()
```

**Retorno**

[`byte[]`](https://learn.microsoft.com/dotnet/api/system.byte)

---

### `StartAsync()`

```csharp
public Task<byte[]> StartAsync()
```

**Retorno**

[`Task<byte[]>`](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)

---

### `StartWithWebPki(AuthenticationOptions)`

```csharp
public string StartWithWebPki(AuthenticationOptions options)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `options` | [`AuthenticationOptions`](https://docs.lacunasoftware.com/api/Lacuna.RestPki.Client/AuthenticationOptions) |  |

**Retorno**

[`string`](https://learn.microsoft.com/dotnet/api/system.string)

---

### `StartWithWebPki(Guid)`

```csharp
public string StartWithWebPki(Guid securityContextId)
```

**Parâmetros**

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

**Retorno**

[`string`](https://learn.microsoft.com/dotnet/api/system.string)

---

### `StartWithWebPkiAsync(AuthenticationOptions)`

```csharp
public Task<string> StartWithWebPkiAsync(AuthenticationOptions options)
```

**Parâmetros**

| Nome | Tipo | Descrição |
|---|---|---|
| `options` | [`AuthenticationOptions`](https://docs.lacunasoftware.com/api/Lacuna.RestPki.Client/AuthenticationOptions) |  |

**Retorno**

[`Task<string>`](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)

---

### `StartWithWebPkiAsync(Guid)`

```csharp
public Task<string> StartWithWebPkiAsync(Guid securityContextId)
```

**Parâmetros**

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

**Retorno**

[`Task<string>`](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)

---

## Membros herdados

[`GetType()`](https://learn.microsoft.com/dotnet/api/system.object.gettype), [`MemberwiseClone()`](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [`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)
