O24OpenAPI.Kit 1.0.0

dotnet add package O24OpenAPI.Kit --version 1.0.0
                    
NuGet\Install-Package O24OpenAPI.Kit -Version 1.0.0
                    
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="O24OpenAPI.Kit" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="O24OpenAPI.Kit" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="O24OpenAPI.Kit" />
                    
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 O24OpenAPI.Kit --version 1.0.0
                    
#r "nuget: O24OpenAPI.Kit, 1.0.0"
                    
#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 O24OpenAPI.Kit@1.0.0
                    
#: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=O24OpenAPI.Kit&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=O24OpenAPI.Kit&version=1.0.0
                    
Install as a Cake Tool

O24OpenAPI.Kit

O24OpenAPI.Kit là thư viện tiện ích dùng chung cho các dự án thuộc hệ sinh thái O24OpenAPI.

🎯 Mục đích

Thư viện cung cấp các hàm hỗ trợ:

  • Tạo chữ ký (signature)quản lý xác thực.

    • Phía đối tác: sử dụng O24OpenAPI.Kit để sinh chữ ký từ payload trước khi gửi request sang hệ thống O24OpenAPI.
    • Phía O24OpenAPI: thực hiện verify chữ ký để đảm bảo tính toàn vẹn và xác thực dữ liệu.
  • KeyVault utilities: quản lý khóa, connection string, secret.

  • Models & Utils: các models dùng chung và hàm tiện ích hỗ trợ chuẩn hoá dữ liệu.


📦 Cài đặt

1. Thêm source từ NuGet feed nội bộ GitLab (Project ID = 327)

dotnet nuget add source "https://delivery-gitlab.jits.com.vn/api/v4/projects/327/packages/nuget/index.json" \
  --name GitLabO24Framework \
  --username gitlab-ci-token \
  --password <YOUR_PERSONAL_ACCESS_TOKEN> \
  --store-password-in-clear-text

2. Cài đặt package

dotnet add package O24OpenAPI.Kit --version 1.0.0

🚀 Ví dụ sử dụng

1. Sinh chữ ký từ payload

using O24OpenAPI.Kit.Signature;

var payload = "{ \"amount\": 1000000, \"currency\": \"VND\" }";
var privateKey = "..."; // private key do O24OpenAPI cung cấp

var (signature, timestamp, nonce) = SignatureExtension.GetSignature(payload, privateKey);

Console.WriteLine($"Signature : {signature}");
Console.WriteLine($"Timestamp : {timestamp}");
Console.WriteLine($"Nonce     : {nonce}");

🔑 Khi gửi request sang O24OpenAPI, đối tác cần đính kèm:

  • Signature
  • Timestamp
  • Nonce

👉 Hệ thống O24OpenAPI sẽ verify các giá trị này để đảm bảo request chưa bị chỉnh sửa.


2. Lấy secret từ KeyVault

using O24OpenAPI.Kit.Keyvault;

var secret = KeyvaultExtension.GetSecretKey("DB_CONNECTION");
Console.WriteLine(secret);

🔄 Quy trình gen & verify signature

sequenceDiagram
    participant Partner as Đối tác (Client)
    participant Kit as O24OpenAPI.Kit
    participant API as O24OpenAPI Server

    Partner->>Kit: Gọi GetSignature(payload, privateKey)
    Kit-->>Partner: signature, timestamp, nonce
    Partner->>API: Gửi payload + signature + timestamp + nonce
    API->>API: Verify signature với publicKey
    API-->>Partner: Trả về kết quả (OK / lỗi xác thực)

⚙️ Yêu cầu hệ thống

  • .NET 8.0 trở lên
  • Các dependency chính:
    • Newtonsoft.Json
    • O24OpenAPI.KeyVault

📌 Đóng góp & liên hệ

Mọi issue / yêu cầu hỗ trợ vui lòng trao đổi tại GitLab nội bộ:
👉 delivery-gitlab.jits.com.vn/delivery/jits/O24OpenAPI.Kit

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
1.0.0 246 8/30/2025