Repository navigation
Description
Execution plan
Goal: Provide APIs fully compatible with full/Desktop .NET Framework (no changes as part of this work - straight port only)
Plan:
- 1. Add the source code on GH sanitized, with licenses, etc. (it won't build)
- 2. Make the source code build (still excluded from overall repo build)
- 3. Remove Desktop registry-compat code paths
- Remove methods that have [RegistryPermission] (Utils and SignedXml classes) along with any owned methods
- Address any other registry-related compile errors such as those using Registry, RegistryPermission, RegistryKey, etc (delete code as necessary)
- 4. Add tests (We have to agree on expected code coverage and how much of the spec we have to cover)
- Compare test results between Desktop and .NET Core implementations
- 5. Make it part of overall repo build & ship it!
Code changes rules: Only code changes absolutely necessary to make it build and compatible with (full) .NET Framework are allowed, no additional bug fixes or changing architecture - such PRs will be rejected now.
Changes like that can be considered after the initial port is done, when we have a good test bed and when we are able to validate such change.
If larger code/architecture changes are needed from some reason, we should discuss them first here, before doing the work / submitting PR.
If you work on some parts of the plan, please say so in the discussion to avoid duplicated work. We (@steveharter @karelz) will co-assign the issue to you.
Original
The class to digitally sign XML needs to be added.
Activity
rschiefer commentedon Feb 12, 2016
As referenced by Tratcher, this is a blocker for adding support for WsFederation/ADFS in ASP.NET 5. We use ADFS extensively for many enterprise ASP.NET 4 applications. We are very interested in migrating to ASP.NET 5 and using WsFederation.
bartonjs commentedon Feb 12, 2016
@rschiefer @Tratcher Well, it's... complicated.
So we're left with the conundrum of:
@terrajobst - fyi
bartonjs commentedon Feb 12, 2016
Apparently I was a bit rambly this morning. Sorry :).
We've definitely identified that there's work to be done here, but we don't think the right answer is to bring forward the existing System.Security.Cryptography.Xml code. Instead, this represents the item on our backlog to engineer a general-purposed implementation for XmlDSig which is fast and not tied to legacy object models (e.g. XmlDocument).
That effort isn't something that we're expecting to do for .NET Core 1.0, simply because we're focused on other things.
But, letting us know that you're impacted by the missing functionality does help with ongoing prioritization.
AndersAbel commentedon Apr 1, 2016
I'm looking at creating an ASP.NET Core SAML2 Middleware, based on https://github.com/KentorIT/authservices. Without a SignedXml port it won't be able to run on the Core framework.
I definitely do agree that not carrying over the existing one is a good idea. Would it be possible to do anything based on an XmlReader API? That way both XDocument and XmlDocument can be supported. Also providing an implementation of the enveloped reader used in System.IdentityModel would be nice (if it was improved to support XML files with whitespace...)
bartonjs commentedon Apr 1, 2016
@AndersAbel XmlReader is where I'd start, yeah (unless the XML guys tell me there's something better).
Since XmlReader what the System.IdentityModel variant is based on, it should be doable :).
AndersAbel commentedon Apr 1, 2016
@bartonjs The System.IdentityModel variant is quite limited though in what transforms it can handle. For SAML2/WS-Fed work it wouldn't be a problem, but as a general API it must be considered how to deal with non-enveloped signatures and xml containing nested signatures (such as a signed saml response containing signed assertions). Also I think that the System.IdentityModel.EnvelopedSignatureReader is copying the data when doing the validation. There's a lot of fun to be done there. If I had the time I'd love to work on it.
Icestorm0141 commentedon Apr 18, 2016
I appreciate the rambling @bartonjs, helps to see whats going on behind the scenes.
Currently my company is impacted by this. We have some legacy code that we're trying to port over to .NET Core that generates signed XML license files and without this set of classes we're stuck. We're open to diverging from XML files as the base for the licenses but as of this moment we haven't found a good solution that fits our needs.
Looking forward to seeing this get added in the future.
sandersaares commentedon May 26, 2016
I can attest that this (and also the slightly related XML Encryption) is relevant for us. The existing form in .NET Framework would be just fine - no need for innovation here, from my perspective. Copy & paste implementation would be very welcome!
Is there currently any workaround available?
af0l commentedon Jun 5, 2016
Would like to know what @sandersaares asked, too. There's no built in way to sign xml in the CoreFX now?
bartonjs commentedon Jun 6, 2016
@sandersaares / @af0l : There is not, for .NET Core 1.0, any inbuilt implementation of SignedXml/XmlDSig.
Based off of comments here (and others) we'll probably just bring over the old API, but we didn't have time to make it happen for 1.0.
af0l commentedon Jun 6, 2016
Thank you @bartonjs, that must be the reason I could not get our project to work on Core. :) It's also a great shame, because I'd love to move ahead and can't until it's done. We have to report all payments to our tax authority using signed xml's, so it's a showstopper really.
emailtowalter commentedon Jul 11, 2016
Any progress on this? I am stuck with the SAML token validation which requires this feature. Thanks
af0l commentedon Jul 11, 2016
Yeah, would liek to know that too. We ended up extracting the features needing the signature and putting them into a separate web API solution...
john182 commentedon Jul 24, 2016
Already have idea on which version will be implemented or solution
240 remaining items
jaedson-barbosa commentedon Apr 24, 2017
Hi, now you can use this package in a UWP app, here a sample app: https://github.com/JaedsonBarbosa/corefx/tree/BigOptimization/src/System.Security.Cryptography.Xml/TesteAssinatura
karelz commentedon Apr 24, 2017
@JaedsonBarbosa great! Is there anything from your work which would be valuable to flow back into CoreFX? (i.e. things which are not temporary hacks)
jaedson-barbosa commentedon Apr 24, 2017
@karelz Well, I think you can use my project to see what can you simplify (or remove) in the CoreFX 😄
leopignataro commentedon May 16, 2017
Hello everybody, great effort on porting this!
May I ask why is the Nuget package referencing .NET Core 2.0, instead of .NET Standard 2.0? Wouldn't that be preferred?
danmoseley commentedon May 17, 2017
That should have been done (c4650c9)
I'm guessing you're looking at the official preview on Nuget
https://www.nuget.org/packages/System.Security.Cryptography.Xml/4.4.0-preview1-25305-02
and it's only got to Myget
https://dotnet.myget.org/feed/dotnet-core/package/nuget/System.Security.Cryptography.Xml/4.4.0-preview2-25316-02
leopignataro commentedon May 17, 2017
Yes, that's were I was looking. Thank you, @danmosemsft!
danmoseley commentedon May 17, 2017
@leopignataro no problem, I encourage you to try bits from "head" -- you can get them from the homepage here https://github.com/dotnet/cli ... you can just download the zip if you want. Let us know if you find issues -- we have only a little time left to fix them before release.
karelz commentedon May 17, 2017
FYI: Here's info about timelines: https://github.com/dotnet/corefx/issues/17619#issuecomment-301937346
leopignataro commentedon May 25, 2017
Since you mention it, @danmosemsft, there's this one issue:
https://github.com/dotnet/corefx/issues/19198
I've suggested a fix on the thread but my message may have been missed in all the buzz.
karelz commentedon May 25, 2017
@leopignataro fix for what where? If it is fix for dotnet/corefx#19198, then it should be tracked in the bug. If it is something else, I would prefer to see separate issue for it.
If you think your fix suggestion was overlooked somewhere, raise it again on that thread and ask for feedback.
fletchsod-developer commentedon Sep 6, 2017
I'm confused now. I thought System.Security.Cryptography.Xml NuGet package is for .NET Framework and it is already included in Dot Net Core v2. It's not recognizing this namespace in Dot Net Core v2. Did I hear this incorrectly? Thanks.
bartonjs commentedon Sep 6, 2017
@fletchsod-developer The package is mainly for .NET Core. But if you reference it from a library targeting .NET Standard it will unify with the .NET Framework version on .NET Framework, and run the code from within the package on .NET Core.
We don't have any plans to put SignedXml into the default install experience for .NET Core; it's niche enough that being a separate package on NuGet seems the best distribution model.