Vimes.SignSDK
1.0.22
See the version list below for details.
dotnet add package Vimes.SignSDK --version 1.0.22
NuGet\Install-Package Vimes.SignSDK -Version 1.0.22
<PackageReference Include="Vimes.SignSDK" Version="1.0.22" />
<PackageVersion Include="Vimes.SignSDK" Version="1.0.22" />
<PackageReference Include="Vimes.SignSDK" />
paket add Vimes.SignSDK --version 1.0.22
#r "nuget: Vimes.SignSDK, 1.0.22"
#:package Vimes.SignSDK@1.0.22
#addin nuget:?package=Vimes.SignSDK&version=1.0.22
#tool nuget:?package=Vimes.SignSDK&version=1.0.22
Vimes.SignSDK
A lightweight, infrastructure-agnostic library for digital signature integration. This SDK supports multiple merchants (SmartCA, Viettel MySign, VNPT, USB Token, etc.) and provides a simplified interface for signing PDF documents using purely file-system and in-memory operations.
Quick Start
1. Installation
Install the package via NuGet:
dotnet add package Vimes.SignSDK
2. Configuration
Add the following configuration to your appsettings.json. The SDK is now database-free and uses local storage for temporary files and logs.
{
"InternalSetting": {
"HospitalName": "Your Hospital",
"CompanyName": "Your Company",
"DefaultMerchantId": "VIETTEL",
"SignatureMode": 0,
"IsEnableRegisterExtension": true
},
"FileStorageSetting": {
"WebRootFallback": "wwwroot",
"ExportFolderName": "export",
"CertsFolderName": "certs"
},
"MySignSetting": {
"BaseUrl": "https://remotesigning.viettel.vn",
"ProfileId": "your-profile-id",
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret"
},
"CacheSetting": {
"Backend": "Memory"
}
}
3. Dependency Injection
Register the SignSDK services in your Program.cs:
using SignSDK;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSignSDK(builder.Configuration);
var app = builder.Build();
4. Basic Usage
public class MyService
{
private readonly ISignSDKClient _signClient;
public MyService(ISignSDKClient signClient)
{
_signClient = signClient;
}
public async Task SignDocument(string userName, string password, byte[] pdfData)
{
var session = await _signClient.LoginAsync(userName, password, "VIETTEL");
var certs = await _signClient.GetCertificatesAsync(userName, session.BearerToken);
var result = await _signClient.SignDocumentAsync(new SignDocumentRequest
{
UserName = userName,
MerchantId = "VIETTEL",
CredentialID = certs[0].credentialID,
FileName = "record.pdf",
FileData = Convert.ToBase64String(pdfData),
Page = 1, X = 100, Y = 100, Width = 150, Height = 75
});
}
}
Supported Merchants
| Package | Merchant | Type |
|---|---|---|
Vimes.SignSDK.Merchants.MySign |
Viettel MySign | Remote CA (cloud) |
Vimes.SignSDK.Merchants.SmartCA |
VNPT SmartCA | Remote CA (cloud) |
Vimes.SignSDK.Merchants.BCY |
Ban Co Yeu | Remote CA (HSM) |
Vimes.SignSDK.Merchants.CMC |
CMC CA | Remote CA (cloud) |
Vimes.SignSDK.Merchants.InTrust |
InTrust CA | Remote CA (cloud) |
Vimes.SignSDK.Merchants.SIM |
SIM/MSSP | Mobile OTP |
Vimes.SignSDK.Merchants.USB |
USB Token | Local (PKCS#11 / CNG) |
Vimes.SignSDK.Merchants.Self |
Self-signed | Local (.p12 / .pfx) |
USB Token Merchant
The USB merchant signs locally using the user's physical USB token — no cloud, no internet required.
How it works:
UsbTokenAgent.exeruns silently in the background (auto-started by WinFormsSample)- SDK calls
POST /login,POST /certs,POST /signHashonhttp://127.0.0.1:9999/ - Agent signs via PKCS#11 (bit4id
bit4xpki.dll) or Windows CNG fallback
Configuration:
"UsbSetting": {
"UsbAgentIp": "127.0.0.1",
"UsbAgentPort": 9999,
"UsbTokenPin": "your-pin",
"UsbAgentExePath": ""
}
UsbTokenAgent.exe is downloaded automatically at build time from the public release repo.
See usb-token-agent-dist for manual installation and full documentation.
Architecture
- Infrastructure Agnostic: Zero dependency on EF Core, SQL Server, or PostgreSQL
- Stateless Operation: No internal database state — host applications manage persistence
- Zero-Redis: Uses
MemoryCacheby default for session and certificate caching - File-Based Logging: Audit logs via Serilog text sinks
- Merchant Plugins: Plugin-based architecture for easy merchant extension
Samples
- WinForms Sample: Full UI demo — vn-sign-sample
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- AutoMapper (>= 12.0.1)
- EPPlus (>= 6.2.10)
- itext7 (>= 7.2.5)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- Otp.NET (>= 1.4.1)
- Serilog (>= 4.3.1)
- Serilog.Extensions.Logging (>= 8.0.0)
- System.IdentityModel.Tokens.Jwt (>= 8.18.0)
- System.ServiceModel.Duplex (>= 4.10.3)
- System.ServiceModel.Federation (>= 4.10.3)
- System.ServiceModel.Http (>= 4.10.3)
- System.ServiceModel.NetTcp (>= 4.10.3)
- System.ServiceModel.Security (>= 4.10.3)
- Vimes.Core (>= 1.0.22)
- Vimes.Signature.Domain (>= 1.0.22)
- Vimes.SignSDK.Abstractions (>= 1.0.22)
- Vimes.SignSDK.Merchant.Base (>= 1.0.22)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Vimes.SignSDK:
| Package | Downloads |
|---|---|
|
Vimes.SignSDK.Merchants.BCY.Domain
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.