# AES module user guide

This guide explains how to use the AES module within the onboarding session.

## Add it to the flow

To add the AES module to the flow, add it to the `IncdOnboardingFlowConfiguration`:

```undefined
  flowConfig.addAes(showCertificateOnSuccess: true/false)
```

The default value of `showCertificateOnSuccess` is false, and the AES module will show only the success screen and then close it automatically. Specify `true` to show the preview screen with the signed docs after the document was signed successfully.

## Process the AES result

Add a callback to your `IncdOnboardingDelegate`:

```undefined
  func onAesCompleted(_ result: AESResult) {
    // process result
  }
```

Regardless of the outcome, the `onAesCompleted` method will be called and the user will continue with the flow (if there are specified modules after AES).

`AESResult` struct contains:

- `success`: if signing is a success
- `error`: An AES signing error. `nil` means there were no errors.

`AESError` enum possible values:

- `noDocuments`: No documents are available for the onboarding session
- `failedToSign`: AES signing failed.

## License

Copyright 2023 Incode Technologies. All rights reserved.

Updated 3 months ago.
