bc-csharp icon indicating copy to clipboard operation
bc-csharp copied to clipboard

Feature Request: NativeAOT support

Open InstinctTheDevil opened this issue 1 year ago • 0 comments

Hello! I recently wanted to use the FiddlerCore library which relys on bc-csharp

But I found large issues while attempting to implement this while using NativeAOT in .NET 8.0

Here's my stacktrace:

** LogString: Fiddler ICertificateProvider v5.0.2.0 loaded.
        fiddler.certmaker.bc.Debug:     False
        ObjectID:                       0x3ac326b
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Org.BouncyCastle.Asn1.Pkcs.Pfx..ctor(Asn1Sequence seq) + 0x15
   at Org.BouncyCastle.Pkcs.Pkcs12Store.Load(Stream input, Char[] password) + 0x74
   at BCCertMaker.BCCertMaker.ReadRootCertificateAndPrivateKeyFromStream(Stream pkcs12Stream, String password, String alias) + 0x55
   at BCCertMaker.BCCertMaker.ReadRootCertificateAndPrivateKeyFromPkcs12File(String filename, String password, String alias) + 0x73
   at CaptureTraffic.Program.EnsureRootCertificate() + 0xaa
   at CaptureTraffic.Program.Main() + 0xe
   at Program!<BaseAddress>+0x790638


I'll gladly contribute to adding support if we can find the root cause to this.

InstinctTheDevil avatar Oct 03 '23 18:10 InstinctTheDevil