MisaConnect.ESign
2.0.2
dotnet add package MisaConnect.ESign --version 2.0.2
NuGet\Install-Package MisaConnect.ESign -Version 2.0.2
<PackageReference Include="MisaConnect.ESign" Version="2.0.2" />
<PackageVersion Include="MisaConnect.ESign" Version="2.0.2" />
<PackageReference Include="MisaConnect.ESign" />
paket add MisaConnect.ESign --version 2.0.2
#r "nuget: MisaConnect.ESign, 2.0.2"
#:package MisaConnect.ESign@2.0.2
#addin nuget:?package=MisaConnect.ESign&version=2.0.2
#tool nuget:?package=MisaConnect.ESign&version=2.0.2
![]()
MisaConnect.ESign
📖 Docs: https://chukhali.github.io/MisaConnect/esign/
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.EInvoicepackage.
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
- Getting started
- Configuration reference
- Sandbox setup
- Architecture overview
- MISA API reference
- CHANGELOG
License
MIT — see LICENSE.
| Product | Versions 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. |
-
net8.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.