Coder Social home page Coder Social logo

Comments (6)

DevTrevi avatar DevTrevi commented on September 28, 2024 1

Thanks @FrancescoBonizzi and @Mrizzi-96 for the informations, I will look into this problem as soon as I can

from dgcreader.

DevTrevi avatar DevTrevi commented on September 28, 2024

Hi @Mrizzi-96 , thank you for reporting this problem.

The library does not need a dependency to BouncyCastle when targeting .NET (5 or greater), because for recent version of .NET it uses the apis under the System.Security.Cryptography namespace instead.

If you are targeting .NET5 you should be able to remove this dependency. Can you tell me something more about your project and what error did you get without this dependency?

from dgcreader.

FrancescoBonizzi avatar FrancescoBonizzi commented on September 28, 2024

I have a similiar issue: I wrapped your library in a .NET Standard 2.0 library, but I reference it in a .NET 6 console application, and it throws this exception:

Validation failed with error Could not load file or assembly 'BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942'. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942'. The system cannot find the file specified.  File name: 'BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942'     at DgcReader.RuleValidators.Italy.CertificateExtendedKeyUsageUtils.GetExtendedKeyUsages(SignatureValidationResult signatureValidation, ILogger logger)     at DgcReader.RuleValidators.Italy.DgcItalianRulesValidator.IsRecoveryPvSignature(SignatureValidationResult signatureValidationResult)     at DgcReader.RuleValidators.Italy.DgcItalianRulesValidator.CheckRecoveryStatements(EuDGC dgc, ItalianRulesValidationResult result, IEnumerable`1 rules, SignatureValidationResult signatureValidation, ValidationMode validationMode)     at DgcReader.RuleValidators.Italy.DgcItalianRulesValidator.GetRulesValidationResult(EuDGC dgc, DateTimeOffset validationInstant, ValidationMode validationMode, SignatureValidationResult signatureValidationResult, BlacklistValidationResult blacklistValidationResult, CancellationToken cancellationToken)

Note two things:

  • I fixed in the same way as the developer that posted the issue
  • I read this exception because I implemented all loggers, but the output is Cerificate not valid. Maybe it could be helpful to make the Exception exit from the Verify method?

from dgcreader.

DevTrevi avatar DevTrevi commented on September 28, 2024

Thank you @FrancescoBonizzi , I will investigate this behavior as soon as possible.
Can you give me some details about how dependencies are configured in your projects?
Are you referencing the library this way:

└─ Application project (.net 6)
    └─ Class Library (.netstandard2.0)
        └─ DgcReader libraries

or this way:

└─ Application project (.net 6)
    ├─ DgcReader libraries
    └─ Class Library (.netstandard2.0)
        └─ DgcReader libraries

from dgcreader.

FrancescoBonizzi avatar FrancescoBonizzi commented on September 28, 2024

Thanks a lot!

Like this:

image

If I am not wrong it is the first choice you wrote!

from dgcreader.

Mrizzi-96 avatar Mrizzi-96 commented on September 28, 2024

Hi @DevTrevi , @FrancescoBonizzi,
The error I mentioned is the same one that @FrancescoBonizzi had. The difference lies in the fact that my project is fully written in .NET 5.0, and does not reference other projects written in .NET standard 2.0.
Henceforth, my file structure looks like this:
Issue_Project_structure_DgcReader
The library in the red square was added manually.
Hope this helps!

from dgcreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.