Bitzsoft.Integrations.LegalDatabase.Metalaw 1.0.0-alpha.10

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

Bitzsoft.Integrations.LegalDatabase.Metalaw

MetaLaw 法规案例库 SSO 跳转集成 — 基于国密 SM3 签名生成单点登录访问链接。

功能特性

  • SM3 签名 SSO:构造参数 → 按属性名字典序拼接 → SM3 哈希签名 → JSON + Base64 + URL 编码 → 拼接登录 URL
  • 国密算法:内置 Sm3Helper(基于 BouncyCastle)提供 SM3 摘要算法
  • 本地签名无 HTTP:签名与拼接完全在本地完成,不发起外部 HTTP 请求
  • 统一接口:实现 ILegalDatabaseProvider,与其他法律数据库供应商无缝替换

安装

.NET CLI

dotnet add package Bitzsoft.Integrations.LegalDatabase.Metalaw

PackageReference

<PackageReference Include="Bitzsoft.Integrations.LegalDatabase.Metalaw" Version="1.0.0" />

配置

appsettings.json

{
  "LegalDatabase": {
    "Metalaw": {
      "BaseUrl": "https://meta.law/",
      "AppId": "your-app-id",
      "SecretKey": "your-secret-key",
      "LoginUrl": "https://meta.law/api/open/login"
    }
  }
}
配置项 说明 必填
BaseUrl MetaLaw 基础 URL(默认 https://meta.law/
AppId MetaLaw 分配的应用 ID
SecretKey MetaLaw 分配的密钥(用于 SM3 签名)
LoginUrl 登录接口 URL(默认 https://meta.law/api/open/login

注册服务

从 IConfiguration 绑定(推荐)

using Bitzsoft.Integrations.LegalDatabase.Metalaw;

builder.Services.AddBitzsoftMetalawLegalDatabase(
    builder.Configuration.GetSection("LegalDatabase:Metalaw"));

委托配置

builder.Services.AddBitzsoftMetalawLegalDatabase(options =>
{
    options.AppId = "your-app-id";
    options.SecretKey = "your-secret-key";
});

使用示例

using Bitzsoft.Integrations.LegalDatabase;

public class LoginController : ControllerBase
{
    private readonly ILegalDatabaseProvider _provider;

    public LoginController(ILegalDatabaseProvider provider) => _provider = provider;

    [HttpGet("login/metalaw")]
    public async Task<IActionResult> Login(string userId)
    {
        var access = await _provider.GenerateAccessUrlAsync(userId);
        // access.Url 形如:
        // https://meta.law/api/open/login?p=<Base64 编码的 JSON 载荷>
        return Redirect(access.Url);
    }
}

签名流程

  1. 构造参数对象 { uid, appId, nickName, timestamp }
  2. 按属性名字典序拼接 key=value,追加 secretKey={SecretKey}
  3. 对拼接字符串计算 SM3 哈希作为 sign
  4. sign 加入对象,JSON 序列化 → Base64 → URL 编码
  5. 拼接最终 URL {LoginUrl}?p={encoded}

MetaLaw 仅支持 SSO 跳转(AccessUrl),调用 SearchAsync / GetDocumentAsync 会抛出 NotSupportedException

请求审计

MetaLaw 为本地 SM3 签名,不发起外部 HTTP 请求,无需 RequestLogging 出站请求记录。

依赖

说明
Bitzsoft.Integrations.LegalDatabase 法规案例库抽象层(ILegalDatabaseProvider
Bitzsoft.Integrations.Compatibility 基础工具库
BouncyCastle.Cryptography 国密 SM3 摘要算法实现
Microsoft.Extensions.Configuration.Abstractions 配置抽象
Microsoft.Extensions.Http IHttpClientFactory
Microsoft.Extensions.Options.ConfigurationExtensions Options 配置节点绑定

相关包

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 (1)

Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.LegalDatabase.Metalaw:

Package Downloads
Bitzsoft.Integrations.LegalDatabase.All

法规案例库聚合包 — 一键集成威科先行、法信、聚法案例、无讼、MetaLaw、把手案例、见微数据、律商联讯、北大法宝、元典、得理法搜、incoPat

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.10 36 7/26/2026
1.0.0-alpha.9 56 7/12/2026
1.0.0-alpha.8 61 7/1/2026
1.0.0-alpha.7 75 6/16/2026
1.0.0-alpha.6 76 6/16/2026
1.0.0-alpha.5 66 6/14/2026
1.0.0-alpha.3 74 6/7/2026