> For the complete documentation index, see [llms.txt](https://docs.digibee.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digibee.com/documentation/connectors-and-triggers/pt-br/connectors/security/asymmetric-cryptography.md).

# Asymmetric Cryptography

Saiba como criptografar ou descriptografar usando o componente Asymmetric Cryptography.

O **Asymmetric Cryptography** criptografa e descriptografa com base em *keys* públicas e privadas.

## Parâmetros

Dê uma olhada nas opções de configuração do componente. Parâmetros suportados por [expressões *Double Braces*](/documentation/connectors-and-triggers/pt-br/double-braces/overview.md) estão marcados com `(DB)`.

<table data-full-width="true"><thead><tr><th width="183">Parâmetro</th><th width="355">Descrição</th><th width="119.75">Valor padrão</th><th>Tipo de dado</th></tr></thead><tbody><tr><td><strong>Account</strong></td><td>Conta a ser utilizada pelo componente. Contas suportadas: <em>Public key</em> ou <em>Private key</em>.</td><td>N/A</td><td><em>String</em></td></tr><tr><td><strong>Crypto Operation</strong></td><td>Tipos de operação disponíveis (<em>Encrypt</em> e <em>Decrypt</em>).</td><td><em>Encrypt</em></td><td><em>String</em></td></tr><tr><td><strong>Fields To Encrypt/Decrypt</strong></td><td>Campos a serem encriptados/decriptados utilizando uma notação com pontos (ex.: body.field1,body.field2,body).</td><td>body.field1,body.field2</td><td><em>String</em></td></tr><tr><td><strong>Algorithm</strong></td><td>Algoritmo a ser utilizado para criptografar/descriptografar dados.</td><td>RSA</td><td><em>String</em></td></tr><tr><td><strong>Operation Mode</strong></td><td>Modo de operação a ser utilizado.</td><td>ECB</td><td><em>String</em></td></tr><tr><td><strong>Padding</strong></td><td>Utilizado em um bloco de cifra no qual os blocos são preenchidos com bytes de padding (ex.: AES 128 <em>bits</em> utiliza 16 <em>bytes</em> de <em>padding</em>).</td><td>OAEPWithSHA1AndMGF1Padding</td><td><em>String</em></td></tr><tr><td><strong>Fail On Error</strong></td><td>Se a opção estiver ativada, a execução do <em>pipeline</em> com erro será interrompida; do contrário, a execução do pipeline continua, mas o resultado vai mostrar um valor falso para a propriedade "<em>success</em>".</td><td>N/A</td><td>Booleano</td></tr></tbody></table>

Para criptografar, você precisa configurar uma conta *Public key* ou passar a *property key* via *body* com a respectiva chave.

Para descriptografar, você precisa configurar uma conta *Private key* ou passar a *property key* via *body* com a respectiva chave.

Se a chave não foi configurada na conta, você precisa especificar na solicitação conforme o modelo abaixo:

```
{"encryptionKey": "-- THE FOLLOWING PUBLIC KEY--"}
```

## Asymmetric Cryptography em Ação <a href="#asymmetric-cryptography-em-ao" id="asymmetric-cryptography-em-ao"></a>

### KEY por ACCOUNT <a href="#key-por-account" id="key-por-account"></a>

**Config**

```
{
"operation": "encrypt",
"algorithm": "RSA",
"operationMode": "ECB",
"padding": "OAEPWithSHA1AndMGF1Padding",
"encryptedFields": "data,data1",
"failOnError": true
}
```

**Payload**

```
{
"data": someData,
"data1": someData1
}
```

**Saída**

```
{
"data": "RXZlbiBpZiBwZXJmZWN0IGNyeXB0b2dyYXBoaWMgcm91dGluZXMgYXJlIH=",
"data1": "RXZlbiBpZifd441mZWN0IGNyeXB0b2dyYXBoaWMgcm91dGluZXMgYXJlIH="
}
```

**Config**

```
{
"operation": "decrypt",
"algorithm": "RSA",
"operationMode": "ECB",
"padding": "OAEPWithSHA1AndMGF1Padding",
"encryptedFields": "data,data1",
"failOnError": true
}
```

**Payload**

```
{
"data": "RXZlbiBpZiBwZXJmZWN0IGNyeXB0b2dyYXBoaWMgcm91dGluZXMgYXJlIH=",
"data1": "RXZlbiBpZifd441mZWN0IGNyeXB0b2dyYXBoaWMgcm91dGluZXMgYXJlIH="
}
```

**Saída**

```
{
"data": someData,
"data1": someData1
}
```

### KEY por REQUEST BODY <a href="#key-por-request-body" id="key-por-request-body"></a>

**Config**

```
{
"operation": "encrypt",
"algorithm": "RSA",
"operationMode": "ECB",
"padding": "OAEPWithSHA1AndMGF1Padding",
"encryptedFields": "data,data1",
"failOnError": true
}
```

**Payload**

```
{
"encryptionKey": "-- THE FOLLOWING PUBLIC KEY--"
"data": someData,
"data1": someData1
}
```

**Saída**

```
{
"data": "RXZlbiBpZiBwZXJmZWN0IGNyeXB0b2dyYXBoaWMgcm91dGluZXMgYXJlIH=",
"data1": "RXZlbiBpZifd441mZWN0IGNyeXB0b2dyYXBoaWMgcm91dGluZXMgYXJlIH="
}
```

**Config**

```
{
"operation": "decrypt",
"algorithm": "RSA",
"operationMode": "ECB",
"padding": "OAEPWithSHA1AndMGF1Padding",
"encryptedFields": "data,data1",
"failOnError": true
}
```

**Payload**

```
{
"encryptionKey": "-- THE FOLLOWING PRIVATE KEY--"
"data": "RXZlbiBpZiBwZXJmZWN0IGNyeXB0b2dyYXBoaWMgcm91dGluZXMgYXJlIH=",
"data1": "RXZlbiBpZifd441mZWN0IGNyeXB0b2dyYXBoaWMgcm91dGluZXMgYXJlIH="
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digibee.com/documentation/connectors-and-triggers/pt-br/connectors/security/asymmetric-cryptography.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
