Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

System.Security.Cryptography.Xml - phase 2 (make it compile) - #14662

Merged
bartonjs merged 22 commits into
dotnet:masterfrom
tintoy:master
Jan 19, 2017
Merged

bartonjs merged 22 commits into
dotnet:masterfrom
tintoy:master

Conversation

@tintoy

@tintoy tintoy commented Dec 21, 2016 •

Copy link
Copy Markdown
Contributor

This is the initial work for phase 2 of dotnet/corefx#4278 (port System.Security.Cryptography.Xml from netfx to corefx).

There are a couple of areas that need review:

  • SR
    • Added an overload to GetResourceString that doesn't require a default value (uses resource key as the default value). Not sure if this is the correct behaviour but the existing code does not use the second parameter.
    • Imported messages from System.Security.txt into Strings.resx. There seem to be a lot of unused strings in here, not sure if you want them trimmed.
  • EncryptedXml
    • Merged the 2 non-default constructors (removing the overload that takes Evidence because as far as I can tell, there is no CAS in corefx).
  • SignedXml
    • Currently using a hard-coded constant for szOID_KEY_USAGE (2.5.29.15) because I can't find an existing constant to represent it. Let me know where you'd like this to live.
    • Changed X509Certificate2.GetAnyPublicKey to X509Certificate2.PublicKey.Key because I can't find an equivalent method in corefx.
    • Stubbed out ReadAdditionalXXX methods because there's no Registry to read from.
  • SymmetricKeyWrap
    • Suppressed code-analysis rule CA5350 because the directive was to port the code as-is.
  • Utils
    • Removed references to Registry, substituting default values where they were previously read from the registry.
    • Removed references to [RegistryPermission] because, as far as I can tell, CAS does not exist in corefx.
    • Copied HexEncode / HexDecode methods from X509Utils in netfx since there appear to be no public equivalents in corefx.
  • KeyInfoX509Data
    • Previously, CryptographicException was constructed with CAPI.CERT_E_CHAINING HRESULT constant. Linked src/Interop/Common/src/Windows/Crypt32/Interop.certificates_types.cs and used Interop.Crypt32.CertChainPolicyErrors.CERT_E_CHAINING since the associated message does not appear in the string resources.

System.Security.Cryptography.Xml.csproj now builds correctly, but System.Security.Cryptography.Xml.Tests.csproj does not. This appears to be due to the steps taken to exclude it from the build.

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants