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
                    
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="Kck.Security.Abstractions" Version="3.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kck.Security.Abstractions" Version="3.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Kck.Security.Abstractions" />
                    
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 Kck.Security.Abstractions --version 3.4.0
                    
#r "nuget: Kck.Security.Abstractions, 3.4.0"
                    
#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 Kck.Security.Abstractions@3.4.0
                    
#: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=Kck.Security.Abstractions&version=3.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Kck.Security.Abstractions&version=3.4.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
3.4.0 179 5/17/2026
3.3.0 170 5/17/2026
3.2.0 174 5/17/2026
3.1.0 168 5/17/2026
3.0.0 174 5/17/2026
2.0.0 170 5/7/2026