Vimes.SignSDK
1.0.10
dotnet add package Vimes.SignSDK --version 1.0.10
NuGet\Install-Package Vimes.SignSDK -Version 1.0.10
<PackageReference Include="Vimes.SignSDK" Version="1.0.10" />
<PackageVersion Include="Vimes.SignSDK" Version="1.0.10" />
<PackageReference Include="Vimes.SignSDK" />
paket add Vimes.SignSDK --version 1.0.10
#r "nuget: Vimes.SignSDK, 1.0.10"
#:package Vimes.SignSDK@1.0.10
#addin nuget:?package=Vimes.SignSDK&version=1.0.10
#tool nuget:?package=Vimes.SignSDK&version=1.0.10
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. The SDK requires standard ASP.NET Core environment and logging services.
using SignSDK;
var builder = WebApplication.CreateBuilder(args);
// Register the infrastructure-agnostic SignSDK
builder.Services.AddSignSDK(builder.Configuration);
var app = builder.Build();
4. Basic Usage
Inject ISignSDKClient to start signing documents programmatically:
public class MyHospitalService
{
private readonly ISignSDKClient _signClient;
public MyHospitalService(ISignSDKClient signClient)
{
_signClient = signClient;
}
public async Task SignPatientRecord(string userName, string password, byte[] pdfData)
{
// 1. Login to merchant
var session = await _signClient.LoginAsync(userName, password, "VIETTEL");
if (!session.Success) throw new Exception(session.ErrorMessage);
// 2. Get available certificates
var certs = await _signClient.GetCertificatesAsync(userName, session.BearerToken);
// 3. Sign the document
var result = await _signClient.SignDocumentAsync(new SignDocumentRequest
{
UserName = userName,
MerchantId = "VIETTEL",
CredentialID = certs[0].credentialID,
FileName = "record.pdf",
FileData = Convert.ToBase64String(pdfData),
SignerName = "Dr. Smith",
Page = 1,
X = 100, Y = 100, Width = 150, Height = 75
});
if (result.Success) {
Console.WriteLine($"Signed file: {result.SignedFileUrl}");
}
}
}
📦 Architecture (Lightweight Version)
- Infrastructure Agnostic: Zero dependency on EF Core, SQL Server, or PostgreSQL.
- Stateless Operation: No internal database state. Host applications manage their own persistence.
- Zero-Redis: Uses
MemoryCacheby default for session and certificate caching. - File-Based Logging: Audit logs and signatures are tracked via Serilog text sinks.
- Merchant Plugins: Includes built-in support for major Vietnamese CAs via a plugin-based architecture.
📂 Samples
- Console Sample: src/Samples/ConsoleSample/Program.cs - A ready-to-run example for testing real merchant connectivity.
- Postman Collection: Postman/BV108_Sign.postman_collection.json - Standard API requests for testing the Web API implementation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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. |
-
net6.0
- AutoMapper (>= 13.0.1)
- EPPlus (>= 7.5.0)
- iTextSharp (>= 5.5.13.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Otp.NET (>= 1.4.1)
- Serilog (>= 4.3.1)
- Serilog.Extensions.Logging (>= 10.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.10)
- Vimes.Signature.Domain (>= 1.0.10)
- Vimes.SignSDK.Abstractions (>= 1.0.10)
- Vimes.SignSDK.Merchant.Base (>= 1.0.10)
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.