Kck.Security.Abstractions
5.0.0
dotnet add package Kck.Security.Abstractions --version 5.0.0
NuGet\Install-Package Kck.Security.Abstractions -Version 5.0.0
<PackageReference Include="Kck.Security.Abstractions" Version="5.0.0" />
<PackageVersion Include="Kck.Security.Abstractions" Version="5.0.0" />
<PackageReference Include="Kck.Security.Abstractions" />
paket add Kck.Security.Abstractions --version 5.0.0
#r "nuget: Kck.Security.Abstractions, 5.0.0"
#:package Kck.Security.Abstractions@5.0.0
#addin nuget:?package=Kck.Security.Abstractions&version=5.0.0
#tool nuget:?package=Kck.Security.Abstractions&version=5.0.0
Kck.Security.Abstractions
Security abstractions — password hashing, encryption, JWT token management, token blacklist, secrets management, and MFA provider contracts.
Installation
dotnet add package Kck.Security.Abstractions
Quick Start
using Kck.Security.Abstractions.Hashing;
using Kck.Security.Abstractions.Token;
// Program.cs — the providers (Kck.Security.Argon2, Kck.Security.Jwt)
builder.Services.AddKckArgon2();
builder.Services.AddKckJwt(opt =>
{
opt.Issuer = "https://auth.example.com";
opt.Audience = "orders-api";
opt.RsaKeyBase64 = builder.Configuration["Jwt:RsaKeyBase64"]; // PKCS#1 private key, from a secret store
});
public class AuthService(IHashingService hasher, ITokenService tokens)
{
public Task<string> HashAsync(string password, CancellationToken ct) => hasher.HashAsync(password, ct);
// Password first, then the stored hash
public Task<bool> VerifyAsync(string password, string storedHash, CancellationToken ct) =>
hasher.VerifyAsync(password, storedHash, ct);
public Task<TokenResult> IssueTokenAsync(string userId, string email, CancellationToken ct) =>
tokens.CreateAccessTokenAsync(new TokenRequest { UserId = userId, Email = email }, ct);
}
// ISecretsManager and ITokenBlacklistService are implemented by
// Kck.Security.Secrets.* and Kck.Security.TokenBlacklist.Redis.
Configuration
| Property | Description | Default |
|---|---|---|
Security:Jwt:Issuer |
JWT issuer claim | — |
Security:Jwt:Audience |
JWT audience claim | — |
Security:Jwt:ExpiryMinutes |
Access token lifetime | 60 |
Security:Argon2:MemoryCost |
Argon2 memory cost (KB) | 65536 |
Resources
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Kck.Core.Abstractions (>= 5.0.0)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on Kck.Security.Abstractions:
| Package | Downloads |
|---|---|
|
Kck.Security.Jwt
RS256-signed JWT ITokenService using Microsoft.IdentityModel.JsonWebTokens. Loads the RSA key from a PEM file or base64-encoded configuration. Generates and validates access tokens with configurable expiry. Registered via AddKckJwt(). |
|
|
Kck.Security.Argon2
Argon2id-backed IHashingService using Konscious.Security.Cryptography. OWASP-recommended defaults (MemorySize=65536KB, Iterations=3). Timing-safe verification via CryptographicOperations.FixedTimeEquals. Registered via AddKckArgon2(). |
|
|
Kck.Security.Totp
RFC 6238-compliant TOTP IMfaProvider for two-factor authentication. Compatible with Google Authenticator and any TOTP app. Generates setup URIs and QR-code-ready secrets. Registered via AddKckTotp(). |
|
|
Kck.Security.Secrets.AzureKeyVault
Azure Key Vault-backed ISecretsManager for secure secret retrieval. Supports DefaultAzureCredential (Managed Identity, developer credentials). Retrieves and deserializes typed secrets by name with optional prefix filtering. Registered via AddKckAzureKeyVault(). |
|
|
Kck.Security.Secrets.UserSecrets
IConfiguration-backed ISecretsManager for local development. Reads secrets from .NET User Secrets or environment variables without any cloud dependency. Suitable for development and CI environments. Registered via AddKckUserSecrets(). |
GitHub repositories
This package is not used by any popular GitHub repositories.