Esi.Core 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Esi.Core --version 1.0.0
                    
NuGet\Install-Package Esi.Core -Version 1.0.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="Esi.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Esi.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Esi.Core" />
                    
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 Esi.Core --version 1.0.0
                    
#r "nuget: Esi.Core, 1.0.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 Esi.Core@1.0.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=Esi.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Esi.Core&version=1.0.0
                    
Install as a Cake Tool

Esi

E-IMZO PKCS#7 imzolarini tekshirish uchun .NET kutubxonasi.

Paketlar

Paket Target Kimga
Esi.Core netstandard2.0 Har qanday .NET loyiha (console, worker, desktop, Framework)
Esi.AspNetCore netcoreapp3.1 ASP.NET Core 3.1+ API loyihalar (attribute bilan)

ASP.NET Core loyihasida Esi.AspNetCoreni o'rnatish yetarli — Esi.Core bog'liqlik sifatida keladi.

O'rnatish

dotnet add package Esi.AspNetCore

Sozlash

builder.Services.AddEsi<TokenEsiIdentityProvider>(o =>
{
    o.BaseUrl = "http://your-esi-backend:8085";
    o.RealIp  = "your-server-ip";
});

IEsiIdentityProvider — foydalanuvchining STIR/JShShIR'ini qayerdan olishni siz belgilaysiz:

public sealed class TokenEsiIdentityProvider : IEsiIdentityProvider
{
    public EsiIdentity? GetIdentity(HttpContext context)
    {
        var user = context.User;

        if (!user.Identity.IsAuthenticated)
            return null;

        return EsiIdentity.For(
            user.FindFirst("tin")?.Value,
            user.FindFirst("pinfl")?.Value);
    }
}

Ishlatish — attribute bilan

Imzoli so'rov modeli EsiSignedRequestdan meros oladi:

public class DeleteOfferModel : EsiSignedRequest
{
    public int OfferId { get; set; }
}

Action'ga [VerifySignature] qo'yiladi — imzo tekshirilmasa action bajarilmaydi:

[HttpPost]
[VerifySignature]
public IActionResult DeleteOffer([FromBody] DeleteOfferModel model)
{
    // Imzo tekshirilgan: kriptografik haqiqiy va foydalanuvchiga tegishli
    return Ok();
}

Ishlatish — qo'lda

Attribute mos kelmasa (imzo ixtiyoriy, identity boshqa manbadan va h.k.):

var result = await esiClient.VerifyAsync(model.Signature, ct);

var validation = Pkcs7SignatureValidator.Validate(
    result, new SignatureCriteria(tin, pinfl));

if (!validation.IsValid)
    return BadRequest(validation.Error);

Faqat kriptografik tekshiruv (egasini solishtirmasdan):

var validation = Pkcs7SignatureValidator.Validate(result);

Tekshiruvni o'tkazib yuborish

Biznes qoidasi bo'yicha ba'zi so'rovlarda imzo talab qilinmasligi mumkin:

public EsiIdentity? GetIdentity(HttpContext context)
{
    var payload = GetPayload(context);

    if (payload is null)
        return null;

    if (payload.IsAgent)
        return EsiIdentity.Skip();   // imzo tekshirilmaydi

    return EsiIdentity.For(payload.Tin, payload.Pinfl);
}

Nima tekshiriladi

E-IMZO backend tomonidan:

  • Imzo buzilmaganmi (Verified)
  • Sertifikat ishonchli zanjirdanmi (CertificateVerified)
  • Imzo qo'yilgan paytda sertifikat amal qilganmi (CertificateValidAtSigningTime)

Kutubxona tomonidan:

  • Imzolovchi sertifikatidagi STIR/JShShIR berilgan qiymatlarga mos keladimi (prioritetli OR: avval STIR, mos kelmasa JShShIR)
  • Ixtiyoriy: sertifikat seriali mos keladimi

Xatolar

SignatureValidationResult.Error qiymatlari:

Qiymat Ma'nosi
NotVerified Imzo kriptografik jihatdan yaroqsiz
SignerMissing Imzolovchi yoki sertifikat topilmadi
ExpiredAtSigningTime Imzo paytida sertifikat amal qilmagan
TinMismatch STIR mos kelmadi
PinflMismatch JShShIR mos kelmadi
SerialMismatch Sertifikat seriali mos kelmadi

Details maydoni — batafsil ma'lumot, faqat log uchun (ichida sertifikat qiymatlari bo'ladi, client'ga chiqarilmasin).

Litsenziya

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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