DotNetCore.Security 16.11.0

DotNetCore.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);
}

HashService

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

JsonWebToken

IJsonWebTokenService

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

    string Encode(IList<Claim> claims);
}

JsonWebTokenService

public class JsonWebTokenService : IJsonWebTokenService
{
    public JsonWebTokenService(JsonWebTokenSettings jsonWebTokenSettings) { }

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

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

JsonWebTokenSettings

public class JsonWebTokenSettings
{
    public JsonWebTokenSettings(string key, TimeSpan expires) { }

    public JsonWebTokenSettings(string key, TimeSpan expires, string audience, string issuer) : this(key, expires) { }

    public string Audience { get; }

    public TimeSpan Expires { get; }

    public string Issuer { get; }

    public SecurityKey SecurityKey { get; }

    public TokenValidationParameters TokenValidationParameters() { }
}

Extensions

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

    public static void AddHashService(this IServiceCollection services) { }

    public static void AddJsonWebTokenService(this IServiceCollection services, string key, TimeSpan expires) { }

    public static void AddJsonWebTokenService(this IServiceCollection services, string key, TimeSpan expires, string audience, string issuer) { }

    public static void AddJsonWebTokenService(this IServiceCollection services, JsonWebTokenSettings jsonWebTokenSettings) { }
}

Showing the top 20 packages that depend on DotNetCore.Security.

Packages Downloads
DotNetCore.AspNetCore
DotNetCore.AspNetCore
1

Version Downloads Last updated
20.15.0 0 5/28/2026
16.11.0 0 5/28/2026