Bitzsoft.Integrations.ElectronicSignature.BestSign 1.0.0-alpha.7

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

Bitzsoft.Integrations.ElectronicSignature.BestSign

上上签电子签章集成。

功能特性

  • 完整实现 IElectronicSignatureProvider 接口:覆盖合同发起、详情、下载、签署 URL、撤销、印章、模板、回调验签全部统一方法
  • partial class 扩展:通过部分类暴露上上签全部 API(签署、模板、用户、实名认证、证据报告)

安装

dotnet add package Bitzsoft.Integrations.ElectronicSignature.BestSign
<PackageReference Include="Bitzsoft.Integrations.ElectronicSignature.BestSign" Version="*" />

认证方式

OAuth2 Client Credentials + RSA256 签名(双层认证):

  1. OAuth2clientId + clientSecretaccess_token(自动刷新)
  2. RSA256 签名:请求体 MD5 → headers 字典排序拼接 → RSA-SHA256 签名

请求 headers:

Authorization: Bearer <access_token>
bestsign-client-id: <developerId>
bestsign-sign-timestamp: <timestamp>
bestsign-signature-type: RSA256
bestsign-signature: <signature>

配置

{
  "BestSign": {
    "ClientId": "your-client-id",
    "ClientSecret": "your-client-secret",
    "DeveloperId": "your-developer-id",
    "PrivateKey": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----",
    "PublicKey": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----",
    "BaseUrl": "https://openapi.bestsign.cn"
  }
}
配置项 说明 默认值
ClientId OAuth2 客户端标识
ClientSecret OAuth2 客户端密钥
DeveloperId 开发者标识
PrivateKey 开发者 RSA 私钥(PKCS#8 PEM)
PublicKey 平台 RSA 公钥(PKCS#8 PEM)
BaseUrl API 基地址 https://openapi.bestsign.cn
Timeout 请求超时 30s
HttpClientName 命名 HttpClient BestSignElectronicSignatureProvider

注册

services.AddBitzsoftBestSignElectronicSignature(options =>
{
    options.ClientId = "your-client-id";
    options.ClientSecret = "your-client-secret";
    options.DeveloperId = "your-developer-id";
    options.PrivateKey = File.ReadAllText("private_key.pem");
    options.PublicKey = File.ReadAllText("public_key.pem");
});

第三方请求日志

内置 Bitzsoft.Integrations.RequestLogging 出站请求记录管道,默认 NullRequestLogStore 不持久化。

// ① 默认:启用记录管道但不持久化(日志丢弃)
services.AddBitzsoftBestSignElectronicSignature(options => { /* ... */ });

// ② 持久化:宿主注册 IRequestLogStore 实现后,所有出站请求自动落库
services.AddRequestLogging<MyRequestLogStore>(opts =>
{
    opts.MaxBodyLength = 8192;
    opts.SensitiveFields.Add("mySecret");
});
services.AddBitzsoftBestSignElectronicSignature(options => { /* ... */ });

回调验签

VerifyCallback 校验 developerId 匹配、时间戳新鲜度、RSA 签名验证。callbackHeaders 为 null 时直接拒绝。

扩展方法(partial class)

  • Signing — 发起签署、签署方状态、合同状态、签署 URL、撤销、下载、回调管理等(9 方法)
  • Templates — 模板创建、修改、删除、详情、变量管理、复制(7 方法)
  • Users — 用户 CRUD、配置管理、印章创建/编辑(8 方法)
  • Verification — 个人/企业认证、认证信息/状态查询(5 方法)
  • Evidence — 证据报告申请、查询、详情(3 方法)

依赖

  • Bitzsoft.Integrations.Compatibility:基础工具库

相关包

供应商 包名
统一抽象 Bitzsoft.Integrations.ElectronicSignature
君子签 Bitzsoft.Integrations.ElectronicSignature.Junziqian
法大大 Bitzsoft.Integrations.ElectronicSignature.Fadada
爱签 Bitzsoft.Integrations.ElectronicSignature.Asign
上上签 Bitzsoft.Integrations.ElectronicSignature.BestSign
e签宝 Bitzsoft.Integrations.ElectronicSignature.ESign
契约锁 Bitzsoft.Integrations.ElectronicSignature.Qiyuesuo
安证通 Bitzsoft.Integrations.ElectronicSignature.Anzhengtong
腾讯电子签 Bitzsoft.Integrations.ElectronicSignature.Tencent
聚合包 Bitzsoft.Integrations.ElectronicSignature.All
基础工具库 Bitzsoft.Integrations.Compatibility
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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 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 is compatible.  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 (2)

Showing the top 2 NuGet packages that depend on Bitzsoft.Integrations.ElectronicSignature.BestSign:

Package Downloads
Bitzsoft.Integrations.All

Bitzsoft 第三方集成聚合包 — 包含全部 Integration 模块

Bitzsoft.Integrations.ElectronicSignature.All

电子签章聚合包 — 包含君子签 / 法大大 / 爱签 / 上上签 / e签宝 / 契约锁 / 安证通 / 腾讯电子签全部实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.7 60 6/16/2026
1.0.0-alpha.6 60 6/16/2026
1.0.0-alpha.5 62 6/14/2026
1.0.0-alpha.3 59 6/7/2026