KernLab.Claim 1.0.0-alpha.3

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

KernLab.Claim

认证引擎包——KernLab.Claim 的核心能力面:JOSE/JWT 签发与验证(ES256,零第三方依赖)、 签名密钥环(双 key 宽限轮换)、PKCE、PBKDF2 凭证、TOTP MFA、KEK 私钥静态加密、 TokenService 授权流(client_credentials / authorization_code / refresh 轮换 / token-exchange)、 存储抽象(IClaimStore 三实现挂同一契约测试)。 依赖仅 KernLab.Claim.Protocol + BCL。

包面

域 类型
JOSE Base64Url · JsonWebKey · JwtCodec(签发)· JwtValidator(验证:签名/时间窗/aud/alg 白名单,none 恒禁)· SigningKeyRing(持久化 + 双 key 宽限,kid 锚点)
安全 PasswordHasher(PBKDF2)· PasswordPolicy · Pkce(S256 强制)· Totp(RFC 6238)· KekProtector(AES-GCM,env CLAIM_KEK)
服务 TokenService(四流 + refresh 轮换 + 重放检测链式撤销)· ClaimException(错误码 → OAuth error 映射)
抽象 IClaimStore · ISigningKeyStore · IAuditLog · IStoreMigration · SessionModels · ClaimOptions

安装

dotnet add package KernLab.Claim

部署认证中心用可执行宿主 kernlab-claim (KernLab.Claim.Server,不打包)——本包面向嵌入式/自建形态与引擎级复用。 消费方取 token / 验签请用 KernLab.Claim.Client SDK。

最小用法

var options = new ClaimOptions { DataDir = null };           // null = memory: 介质(介质是配置)
var store = await TierClaimStore.CreateAsync(options.TierFsSpec);
var keys = SigningKeyRing.Load(options.DataDir, store.CreateKeyStore());
var tokens = new TokenService(store, keys, options);

var issued = await tokens.ClientCredentialsAsync(client, scope: "kernlab.cohort.config.read");

存储形态(介质是配置不是适配器)

IClaimStore 多实现挂同一契约测试:Tier 单机档(KernLab.Claim.Store.Tier——缺省, --fs virtual|local|memory 介质配置化);Synod 集群档(多写者/无状态多副本,Raft 线性一致) 暂离本发布——待 KernLab.Synod.Client alpha.3 回归。

License

MIT © KernLab.Claim Contributors

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-alpha.3 61 10/5/2026
1.0.0-alpha.2 77 9/29/2026
1.0.0-alpha.1 79 9/26/2026