This page describes the workflow to issue a disposable certificate and sign a document.

- [Standard process](#standard-process)
- [Process using an eID assertion](#process-using-an-eid-assertion)


## Standard process


```mermaid
sequenceDiagram
    participant App as Your Application
    participant LD as Lean Disposable
    participant FRA as FRA Service

    App->>LD: checkData (optional)
    LD-->>App: validation result

    App->>LD: getDisposableContract (optional)
    LD-->>App: contract document

    App->>LD: enroll
    LD-->>App: DisposableIssued (cert, certIdOtp)

    App->>LD: sendOtp
    LD-->>App: OTP sent

    Note over App,FRA: Single signature
    App->>FRA: signPKCS1WithSHA256
    FRA-->>App: signature

    Note over App,FRA: Batch signature (alternative)
    App->>FRA: openSession
    App->>FRA: signPKCS1WithSHA256
    FRA-->>App: signature

    App->>LD: uploadDoc (optional)
    LD-->>App: upload confirmed
```

### Steps reference

| Step | Service | Required | Method |
|  --- | --- | --- | --- |
| Validate data | LEAN_DISPOSABLE | No | [`checkData`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-checkdata/lean-checkdata-method) |
| Get disposable contract | LEAN_DISPOSABLE | No | [`getDisposableContract`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-documents/lean-getdisposablecontract-method) |
| Enroll the certificate | LEAN_DISPOSABLE | Yes | [`enroll`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-enroll/lean-enroll-method) |
| Send the OTP | LEAN_DISPOSABLE | Yes | [`sendOtp`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-send-otp/lean-sendotp-method) |
| Sign (single) | FRA | Yes | `signPKCS1WithSHA256` |
| Sign (batch) | FRA | Yes | `openSession` + `signPKCS1WithSHA256` |
| Upload contract and evidence | LEAN_DISPOSABLE | No | [`uploadDoc`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-documents/lean-uploaddoc-method) |


## Process using an eID assertion


```mermaid
sequenceDiagram
    participant App as Your Application
    participant LD as Lean Disposable
    participant FRA as FRA Service

    App->>LD: checkDataWitheIDAssertion (optional)
    LD-->>App: validation result

    App->>LD: getDisposableContractWithEidAssertion (optional)
    LD-->>App: contract document

    App->>LD: enrollDisposableWitheIDAssertion
    LD-->>App: DisposableIssued (cert, certIdOtp)

    App->>LD: sendOtp
    LD-->>App: OTP sent

    App->>FRA: signPKCS1WithSHA256
    FRA-->>App: signature

    App->>LD: uploadDoc (optional)
    LD-->>App: upload confirmed
```

### Steps reference

| Step | Service | Required | Method |
|  --- | --- | --- | --- |
| Validate data | LEAN_DISPOSABLE | No | [`checkDataWitheIDAssertion`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-checkdata/lean-checkdata-eid-assertion-method) |
| Get disposable contract | LEAN_DISPOSABLE | No | [`getDisposableContractWithEidAssertion`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-documents/lean-getdisposablecontractwitheidassertion-method) |
| Enroll the certificate | LEAN_DISPOSABLE | Yes | [`enrollDisposableWitheIDAssertion`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-enroll/lean-enroll-eid-assertion-method) |
| Send the OTP | LEAN_DISPOSABLE | Yes | [`sendOtp`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-send-otp/lean-sendotp-method) |
| Sign | FRA | Yes | `signPKCS1WithSHA256` |
| Upload contract and evidence | LEAN_DISPOSABLE | No | [`uploadDoc`](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-documents/lean-uploaddoc-method) |
| ‌ |  |  |  |