MisaConnect.ESign 2.0.2

dotnet add package MisaConnect.ESign --version 2.0.2
                    
NuGet\Install-Package MisaConnect.ESign -Version 2.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MisaConnect.ESign" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MisaConnect.ESign" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="MisaConnect.ESign" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MisaConnect.ESign --version 2.0.2
                    
#r "nuget: MisaConnect.ESign, 2.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MisaConnect.ESign@2.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MisaConnect.ESign&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=MisaConnect.ESign&version=2.0.2
                    
Install as a Cake Tool

MisaConnect

MisaConnect.ESign

📖 Docs: https://chukhali.github.io/MisaConnect/esign/

NuGet Downloads License: MIT

Community .NET SDK for the MISA eSign RemoteSigning HTTP API. End-to-end PDF / XML / Word / Excel signing, two-factor (OTP) authentication, and webhook-mode (non-blocking) signing — all behind a single IMisaESignClient facade. Targets .NET 8.

Looking for invoice operations (templates, save/preview/lookup/amend)? Install the sibling MisaConnect.EInvoice package.

Install

dotnet add package MisaConnect.ESign

Quickstart

using MisaConnect.ESign.Client;
using MisaConnect.ESign.Client.Dtos;
using MisaConnect.ESign.Infrastructure.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddMisaConnectESign(builder.Configuration);

var host = builder.Build();
var esign = host.Services.GetRequiredService<IMisaESignClient>();

var result = await esign.SignPdfAsync(new SignPdfRequestDto(
    Pdf: await File.ReadAllBytesAsync("input.pdf"),
    DocumentName: "input.pdf",
    SignerName: "Nguyễn Văn A",
    Location: "Hà Nội",
    Reason: "Phê duyệt hợp đồng",
    Contact: "nguyenvana@example.com",
    LogoImageBase64: null,
    DataToBeDisplayed: "<p>Phê duyệt hợp đồng số 2026/05/18-01</p>",
    Page: 1,
    PositionX: 100, PositionY: 100, Width: 200, Height: 80,
    RenderingMode: 1,
    ShowSignedDate: true), CancellationToken.None);

await File.WriteAllBytesAsync("output.signed.pdf", result.SignedPdf);

Behind that one call the SDK runs login → certificate listing → server-side hash → sign submission → status polling → signature attachment, with cached tokens, transparent 401-refresh, and exponential-backoff transport retries.

Configuration

Bind credentials under the Misa:ESign configuration section (env vars, user-secrets, or appsettings):

{
  "Misa": {
    "ESign": {
      "Environment": "Sandbox",
      "BaseUrl": "https://<sandbox-host-issued-by-misa>/",
      "ClientId": "<your-clientId>",
      "ClientKey": "<your-clientKey>",
      "UserName": "<your-misa-user>",
      "Password": "<your-misa-password>",
      "Polling":        { "Interval": "00:00:02", "TotalTimeout": "00:01:00" },
      "TransportRetry": { "MaxAttempts": 3, "BaseDelay": "00:00:00.200", "MaxDelay": "00:00:02" },
      "Errors":         { "IncludeRawErrorMessage": false },
      "Webhook":        { "Mode": "Both", "Session": { "Ttl": "24:00:00" } }
    }
  }
}

For production, switch Environment to Production and BaseUrl to https://esignapp.misa.vn/. The options validator refuses to start if the environment and base-URL host disagree.

Supported operations

Operation Facade method
Sign PDF end-to-end (login → list certs → hash → sign → poll → attach) IMisaESignClient.SignPdfAsync
2FA / OTP — explicit completion of a captured challenge IMisaESignClient.SignInWithOtpAsync
2FA / OTP — request re-delivery IMisaESignClient.ResendOtpAsync
2FA / OTP — transparent (DI-registered IOtpProvider) Application.Abstractions.IOtpProvider
Sign XML (XAdES) end-to-end (string + bytes overloads) IMisaESignClient.SignXmlAsync
Sign Word (OOXML .docx) end-to-end IMisaESignClient.SignWordAsync
Sign Excel (OOXML .xlsx) end-to-end IMisaESignClient.SignExcelAsync
Begin webhook-mode sign (no polling) IMisaESignClient.BeginSign{Pdf,Xml,Word,Excel}Async
Handle inbound MISA webhook envelope IMisaESignClient.HandleWebhookAsync

Documentation

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 94 5/23/2026
2.0.1 90 5/23/2026
2.0.0 93 5/23/2026