KernLab.Claim
1.0.0-alpha.3
dotnet add package KernLab.Claim --version 1.0.0-alpha.3
NuGet\Install-Package KernLab.Claim -Version 1.0.0-alpha.3
<PackageReference Include="KernLab.Claim" Version="1.0.0-alpha.3" />
<PackageVersion Include="KernLab.Claim" Version="1.0.0-alpha.3" />
<PackageReference Include="KernLab.Claim" />
paket add KernLab.Claim --version 1.0.0-alpha.3
#r "nuget: KernLab.Claim, 1.0.0-alpha.3"
#:package KernLab.Claim@1.0.0-alpha.3
#addin nuget:?package=KernLab.Claim&version=1.0.0-alpha.3&prerelease
#tool nuget:?package=KernLab.Claim&version=1.0.0-alpha.3&prerelease
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 | Versions 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. |
-
net8.0
- KernLab.Claim.Protocol (>= 1.0.0-alpha.3)
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 |
发行说明见仓库 CHANGELOG:https://github.com/kernlab-dev/kernlab-claim/blob/main/CHANGELOG.md