DotaNet.Security 18.16.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DotaNet.Security --version 18.16.0                
NuGet\Install-Package DotaNet.Security -Version 18.16.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="DotaNet.Security" Version="18.16.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotaNet.Security --version 18.16.0                
#r "nuget: DotaNet.Security, 18.16.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.
// Install DotaNet.Security as a Cake Addin
#addin nuget:?package=DotaNet.Security&version=18.16.0

// Install DotaNet.Security as a Cake Tool
#tool nuget:?package=DotaNet.Security&version=18.16.0                

DotaNet.Security

Cryptography

ICryptographyService

public interface ICryptographyService
{
    string Decrypt(string value, string salt);

    string Encrypt(string value, string salt);
}

CryptographyService

public class CryptographyService : ICryptographyService
{
    public CryptographyService(string key) { }

    public string Decrypt(string value, string salt) { }

    public string Encrypt(string value, string salt) { }
}

Hash

IHashService

public interface IHashService
{
    string Create(string value, string salt);

    bool Validate(string hash, string value, string salt);
}

HashService

public class HashService : IHashService
{
    public string Create(string value, string salt) { }

    public bool Validate(string hash, string value, string salt) { }
}

Jwt

IJwtService

public interface IJwtService
{
    Dictionary<string, object> Decode(string token);

    string Encode(IList<Claim> claims);

    string Encode(string sub, string[] roles);
}

JwtService

public class JwtService : IJwtService
{
    public JwtService(IConfiguration configuration) { }

    public Dictionary<string, object> Decode(string token) { }

    public string Encode(IList<Claim> claims) { }

    public string Encode(string sub, string[] roles) { }
}

Extensions

public static class Extensions
{
    public static void AddCryptographyService(this IServiceCollection services, string key) { }

    public static void AddHashService(this IServiceCollection services) { }

    public static void AddJwtService(this IServiceCollection services) { }
}
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. 
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
18.16.2 255 9/14/2024
18.16.0 103 9/1/2024