Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 119 additions & 4 deletions src/references/dataProtector/methods/processProtectedData.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@

**Type:** `Address`

This optional parameter allows you to pay for the task using someone elses
This optional parameter allows you to pay for the task using someone else's

Check failure on line 167 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L167

[Vale.Spelling] Did you really mean 'else's'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'else's'?", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 167, "column": 70}}}, "severity": "ERROR"}
voucher. Make sure the voucher's owner has authorized you to use it. This
parameter must be used in combination with `useVoucher: true`.

Expand All @@ -183,6 +183,92 @@
});
```

### encryptResult <OptionalBadge />

Check failure on line 186 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L186

[Vale.Spelling] Did you really mean 'encryptResult'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'encryptResult'?", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 186, "column": 5}}}, "severity": "ERROR"}

Check warning on line 186 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L186

[Google.Headings] 'encryptResult' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'encryptResult' should use sentence-style capitalization.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 186, "column": 5}}}, "severity": "WARNING"}

**Type:** `boolean`
**Default:** `false`

When set to `true`, the computation result will be encrypted using RSA

Check warning on line 191 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L191

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 191, "column": 44}}}, "severity": "WARNING"}

Check notice on line 191 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L191

[Google.Passive] In general, use active voice instead of passive voice ('be encrypted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be encrypted').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 191, "column": 49}}}, "severity": "INFO"}
encryption. This ensures that only you can decrypt and access the result,
providing an additional layer of privacy and security for sensitive computation
outputs.

If `encryptResult` is `true` and no `pemPrivateKey` is provided, a new RSA key

Check notice on line 196 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L196

[Google.Passive] In general, use active voice instead of passive voice ('is provided').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is provided').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 196, "column": 53}}}, "severity": "INFO"}
pair will be automatically generated. The generated private key will be returned

Check warning on line 197 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L197

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 197, "column": 6}}}, "severity": "WARNING"}

Check warning on line 197 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L197

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 197, "column": 65}}}, "severity": "WARNING"}

Check notice on line 197 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L197

[Google.Passive] In general, use active voice instead of passive voice ('be returned').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be returned').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 197, "column": 70}}}, "severity": "INFO"}
in the response as `pemPrivateKey`, which you must securely store to decrypt the
result later.

```ts twoslash
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';

const web3Provider = getWeb3Provider('PRIVATE_KEY');
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
// ---cut---
const processProtectedDataResponse =
await dataProtectorCore.processProtectedData({
protectedData: '0x123abc...',
app: '0x456def...',
encryptResult: true, // [!code focus]
});
```

::: tip

When `encryptResult` is enabled, the `onStatusUpdate` callback will be notified

Check notice on line 217 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L217

[Google.Passive] In general, use active voice instead of passive voice ('is enabled').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is enabled').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 217, "column": 22}}}, "severity": "INFO"}

Check warning on line 217 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L217

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 217, "column": 64}}}, "severity": "WARNING"}

Check notice on line 217 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L217

[Google.Passive] In general, use active voice instead of passive voice ('be notified').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be notified').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 217, "column": 69}}}, "severity": "INFO"}
with the following additional status titles:

- `'GENERATE_ENCRYPTION_KEY'` - When a new key pair is being generated

Check notice on line 220 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L220

[Google.Passive] In general, use active voice instead of passive voice ('being generated').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('being generated').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 220, "column": 56}}}, "severity": "INFO"}
- `'PUSH_ENCRYPTION_KEY'` - When the public key is being pushed to the secrets

Check notice on line 221 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L221

[Google.Passive] In general, use active voice instead of passive voice ('being pushed').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('being pushed').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 221, "column": 52}}}, "severity": "INFO"}
manager

:::

### pemPrivateKey <OptionalBadge />

Check warning on line 226 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L226

[Google.Headings] 'pemPrivateKey' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'pemPrivateKey' should use sentence-style capitalization.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 226, "column": 5}}}, "severity": "WARNING"}

**Type:** `string`

A PEM-formatted RSA private key used to decrypt the encrypted computation
result. This parameter can only be used when `encryptResult` is set to `true`.

Check notice on line 231 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L231

[Google.Passive] In general, use active voice instead of passive voice ('be used').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be used').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 231, "column": 33}}}, "severity": "INFO"}

Check notice on line 231 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L231

[Google.Passive] In general, use active voice instead of passive voice ('is set').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is set').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 231, "column": 62}}}, "severity": "INFO"}

If you provide a `pemPrivateKey`, it will be used to decrypt the result. If you

Check warning on line 233 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L233

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 233, "column": 38}}}, "severity": "WARNING"}

Check notice on line 233 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L233

[Google.Passive] In general, use active voice instead of passive voice ('be used').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be used').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 233, "column": 43}}}, "severity": "INFO"}
don't provide one but have `encryptResult: true`, a new key pair will be

Check warning on line 234 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L234

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 234, "column": 66}}}, "severity": "WARNING"}

Check notice on line 234 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L234

[Google.Passive] In general, use active voice instead of passive voice ('be generated').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be generated').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 234, "column": 71}}}, "severity": "INFO"}
generated automatically, and the private key will be returned in the response

Check warning on line 235 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L235

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 235, "column": 46}}}, "severity": "WARNING"}

Check notice on line 235 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L235

[Google.Passive] In general, use active voice instead of passive voice ('be returned').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be returned').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 235, "column": 51}}}, "severity": "INFO"}
for you to store securely.

```ts twoslash
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';

const web3Provider = getWeb3Provider('PRIVATE_KEY');
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
// ---cut---
const processProtectedDataResponse =
await dataProtectorCore.processProtectedData({
protectedData: '0x123abc...',
app: '0x456def...',
encryptResult: true, // [!code focus]
pemPrivateKey:
'-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----', // [!code focus]
});
```

::: danger

If you provide a `pemPrivateKey`, you must also set `encryptResult: true`. The
method will throw a validation error if `pemPrivateKey` is provided without

Check warning on line 257 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L257

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 257, "column": 8}}}, "severity": "WARNING"}

Check notice on line 257 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L257

[Google.Passive] In general, use active voice instead of passive voice ('is provided').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is provided').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 257, "column": 57}}}, "severity": "INFO"}
`encryptResult` being enabled.

Check notice on line 258 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L258

[Google.Passive] In general, use active voice instead of passive voice ('being enabled').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('being enabled').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 258, "column": 17}}}, "severity": "INFO"}

:::

::: tip

The `pemPrivateKey` (whether provided or auto-generated) will be included in the

Check notice on line 264 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L264

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 264, "column": 21}}}, "severity": "INFO"}

Check warning on line 264 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L264

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 264, "column": 58}}}, "severity": "WARNING"}

Check notice on line 264 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L264

[Google.Passive] In general, use active voice instead of passive voice ('be included').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be included').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 264, "column": 63}}}, "severity": "INFO"}
response object when `encryptResult` is `true`. Make sure to securely store this
key if you need to decrypt the result later using the
[getResultFromCompletedTask()](/references/dataProtector/methods/getResultFromCompletedTask)
method.

:::

### args <OptionalBadge />

**Type:** `string`
Expand Down Expand Up @@ -422,18 +508,26 @@
You can expect this callback function to be called with the following titles:

```ts
'FETCH_PROTECTED_DATA_ORDERBOOK';
'FETCH_APP_ORDERBOOK';
'FETCH_WORKERPOOL_ORDERBOOK';
'FETCH_ORDERS';
'PUSH_REQUESTER_SECRET';
'GENERATE_ENCRYPTION_KEY';
'PUSH_ENCRYPTION_KEY';
'REQUEST_TO_PROCESS_PROTECTED_DATA';
'TASK_EXECUTION';
'CONSUME_TASK';
'CONSUME_RESULT_DOWNLOAD';
'CONSUME_RESULT_DECRYPT';
```

Once with `isDone: false`, and then with `isDone: true`

::: info

The `'GENERATE_ENCRYPTION_KEY'` and `'PUSH_ENCRYPTION_KEY'` status titles are
only triggered when `encryptResult` is set to `true`.

Check notice on line 527 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L527

[Google.Passive] In general, use active voice instead of passive voice ('is set').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is set').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 527, "column": 37}}}, "severity": "INFO"}

:::

## Return Value

```ts twoslash
Expand Down Expand Up @@ -492,6 +586,27 @@

:::

### pemPrivateKey

Check warning on line 589 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L589

[Google.Headings] 'pemPrivateKey' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'pemPrivateKey' should use sentence-style capitalization.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 589, "column": 5}}}, "severity": "WARNING"}

`string`

The PEM-formatted RSA private key used to decrypt the encrypted computation
result. This property is only present in the response when `encryptResult` is

Check notice on line 594 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L594

[Google.Passive] In general, use active voice instead of passive voice ('is set').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is set').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 594, "column": 76}}}, "severity": "INFO"}
set to `true`.

If you provided a `pemPrivateKey` in the parameters, the same key will be

Check warning on line 597 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L597

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 597, "column": 67}}}, "severity": "WARNING"}

Check notice on line 597 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L597

[Google.Passive] In general, use active voice instead of passive voice ('be returned').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be returned').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 597, "column": 72}}}, "severity": "INFO"}
returned. If you didn't provide one but enabled `encryptResult`, a newly
generated private key will be returned, which you must securely store to decrypt

Check warning on line 599 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L599

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 599, "column": 23}}}, "severity": "WARNING"}

Check notice on line 599 in src/references/dataProtector/methods/processProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/methods/processProtectedData.md#L599

[Google.Passive] In general, use active voice instead of passive voice ('be returned').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be returned').", "location": {"path": "src/references/dataProtector/methods/processProtectedData.md", "range": {"start": {"line": 599, "column": 28}}}, "severity": "INFO"}
the result.

::: tip

You can use this `pemPrivateKey` with the
[getResultFromCompletedTask()](/references/dataProtector/methods/getResultFromCompletedTask)
method to decrypt and retrieve the result of a completed task.

:::

<script setup>
import { computed } from 'vue';
import RequiredBadge from '@/components/RequiredBadge.vue'
Expand Down