Kck.Security.Abstractions
3.4.0
dotnet add package Kck.Security.Abstractions --version 3.4.0
NuGet\Install-Package Kck.Security.Abstractions -Version 3.4.0
<PackageReference Include="Kck.Security.Abstractions" Version="3.4.0" />
<PackageVersion Include="Kck.Security.Abstractions" Version="3.4.0" />
<PackageReference Include="Kck.Security.Abstractions" />
paket add Kck.Security.Abstractions --version 3.4.0
#r "nuget: Kck.Security.Abstractions, 3.4.0"
#:package Kck.Security.Abstractions@3.4.0
#addin nuget:?package=Kck.Security.Abstractions&version=3.4.0
#tool nuget:?package=Kck.Security.Abstractions&version=3.4.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
// Program.cs — register concrete providers
builder.Services.AddKckArgon2Hashing();
builder.Services.AddKckJwtTokens(builder.Configuration);
// Password hashing
public class AuthService(IHashingService hasher, ITokenService tokens)
{
public async Task<string> RegisterAsync(string password, CancellationToken ct)
{
// Hash before storing
return await hasher.HashAsync(password, ct);
}
public async Task<bool> VerifyPasswordAsync(
string password, string storedHash, CancellationToken ct)
{
return await hasher.VerifyAsync(password, storedHash, ct);
}
public async Task<TokenResult> IssueTokenAsync(
ClaimsPrincipal principal, CancellationToken ct)
{
return await tokens.GenerateAsync(principal, ct);
}
}
// Encrypt / decrypt sensitive data
public class SecureDataService(IEncryptionService encryption)
{
public async Task<string> StoreSecretAsync(string plainText, CancellationToken ct)
=> await encryption.EncryptAsync(plainText, ct);
}
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 (>= 3.4.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. Supports RSA key loading from file, base64-encoded configuration, or ISecretsManager. 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.Bundle.WebApi
Opinionated ASP.NET Core WebAPI starter pack. Registers Serilog, in-memory caching, JWT auth, Argon2 hashing, InMemory event bus, OpenTelemetry, rate limiting, security headers, CORS, and global exception handling in a single AddKckWebApiDefaults() call. |
|
|
Kck.Security.TokenBlacklist.Redis
Redis-backed ITokenBlacklistService for JWT revocation. Stores blacklisted token identifiers in Redis with automatic TTL expiration. Enables immediate token invalidation on logout or security events. Registered via AddKckTokenBlacklistRedis(). |
|
|
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.