Project

Profile

Help

SaxonCS in .NET 6 Mau app works on Windows but fails on Mac M1: Operation is not supported on this platform: at System.Security.Cryptography.DSA.CreateCore()

Added by Martin Honnen about 2 years ago

I finally managed to at least get a stack trace of my failing attempts to use SaxonCS in a .NET 6 Maui app on a Mac M1:

Operation is not supported on this platform.
   at System.Security.Cryptography.DSA.CreateCore()
   at System.Security.Cryptography.DSA.Create()
   at Saxon.Impl.Overrides.Verifier.verify(String data, String signature)
   at Saxon.Eej.config.Verifier.configure(TextReader reader, Boolean embedded)
   at Saxon.Eej.config.Verifier.readLicenseFile(Stream is)
   at Saxon.Eej.config.Verifier.loadLicense(String filename)
   at Saxon.Impl.Overrides.Verifier.loadLicense(Configuration config)
   at Saxon.Eej.config.Verifier.loadPrimaryLicense(Configuration config)
   at Saxon.Eej.config.ProfessionalConfiguration.loadLicense()
   at Saxon.Eej.config.EnterpriseConfiguration.checkLicensedFeature(Int32 feature, String name, Int32 localLicenseId)
   at Saxon.Api.Processor.checkLicense()
   at Saxon.Api.Processor.init()
   at Saxon.Api.Processor..ctor(Boolean licensedEdition)
   at SaxonCSNuGetLocal1121MauiTest1.MainPage.<RunTransformationToString>g__GetSaxonProcessor|15_0() in /Users/martin/Projects/SaxonCSNuGetLocal1121MauiTest1/SaxonCSNuGetLocal1121MauiTest1/MainPage.xaml.cs:line 122
   at SaxonCSNuGetLocal1121MauiTest1.MainPage.RunTransformationToString(List`1 files) in /Users/martin/Projects/SaxonCSNuGetLocal1121MauiTest1/SaxonCSNuGetLocal1121MauiTest1/MainPage.xaml.cs:line 75

But I have no idea why it fails with .NET 6 Maui but works in a .NET 6 console application on the same machine.

Any ideas?


Replies (4)

Please register to reply

RE: SaxonCS in .NET 6 Mau app works on Windows but fails on Mac M1: Operation is not supported on this platform: at System.Security.Cryptography.DSA.CreateCore() - Added by Michael Kay about 2 years ago

.NET is clearly still struggling in its attempts to make everything cross-platform. MAUI seems to depend a portability layer called the BCL, but I'm struggling to find any definitive specification of what the BCL is.

RE: SaxonCS in .NET 6 Mau app works on Windows but fails on Mac M1: Operation is not supported on this platform: at System.Security.Cryptography.DSA.CreateCore() - Added by Martin Honnen about 2 years ago

The documentation https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.dsa.create?view=net-6.0#system-security-cryptography-dsa-create states [System.Runtime.Versioning.UnsupportedOSPlatform("ios")] and I think that is the reason, the whole MacOs Maui is done through something called "MacCatalyst" on top of ios and if ios doesn't support it then, sadly, I can't use it on MacOs.

RE: SaxonCS in .NET 6 Mau app works on Windows but fails on Mac M1: Operation is not supported on this platform: at System.Security.Cryptography.DSA.CreateCore() - Added by Martin Honnen about 2 years ago

I did some more googling and reading and first it seemed promising to find an issue about another API (Process.Start) being at some time not supported on Mac Catalyst and that complain https://github.com/dotnet/runtime/issues/61295 got it fixed.

For DSA things look different, it seems the decision was made in favour of newer/more modern methods like AES (https://github.com/dotnet/runtime/pull/52978, https://github.com/dotnet/runtime/issues/52758, https://github.com/dotnet/runtime/issues/53017).

I don't understand enough of cryptography to judge that or try a request issue to have MAUI/MacCatalyst DSA reenabled in .NET 6.

RE: SaxonCS in .NET 6 Mau app works on Windows but fails on Mac M1: Operation is not supported on this platform: at System.Security.Cryptography.DSA.CreateCore() - Added by Michael Kay about 2 years ago

Thanks for the references.

All this talk of dropping support for DSA seems to neglect the use case where a document has been signed using DSA and you want to verify the signature 20 years later. That's effectively what we are doing with our license keys: we issued them promising they were perpetual and we're trying to honour that promise. It's surely a major concern to anyone in the data archiving business if old documents cannot be opened because they were signed using an algorithm that has meanwhile fallen out of favour.

    (1-4/4)

    Please register to reply