Skip to content

[Breaking change]: ECDsa/ECDiffieHellman FromXmlString/ToXmlString methods are being marked [Obsolete] #28834

Closed

Description

@bartonjs

Description

The FromXmlString and ToXmlString that are on Elliptic Curve Cryptography types ECDsaCng, ECDiffieHellmanCng, ECDiffieHellmanCngPublicKey, and ECDiffieHellmanPublicKey have been marked as [Obsolete] with diagnostic SYSLIB0042. They were never implemented and always threw a PlatformNotSupportedException exception.

Version

.NET 7 Preview 4

Previous behavior

The members were not obsolete and did not produce a compiler warning.

New behavior

The members are obsolete and produce a compiler warning.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

The members have been marked [Obsolete] because they were never implemented, and always threw an exception.

Recommended action

Callers should use a standard data format for exchanging EC keys.

ToXmlString can use ExportSubjectPublicKeyInfo or ExportPkcs8PrivateKey depending on if the caller wants the public or private key.

FromXmlString can use ImportSubjectPublicKeyInfo or ImportPkcs8PrivateKey depending on if the caller wants to import a public or private key.

Feature area

Cryptography

Affected APIs

  • M:System.Security.Cryptography.ECDiffieHellmanCng.FromXmlString(System.String, System.Security.Cryptography.ECKeyXmlFormat)
  • M:System.Security.Cryptography.ECDiffieHellmanCng.ToXmlString(System.Security.Cryptography.ECKeyXmlFormat)
  • M:System.Security.Cryptography.ECDiffieHellmanCngPublicKey.FromXmlString(System.String)
  • M:System.Security.Cryptography.ECDiffieHellmanCngPublicKey.ToXmlString()
  • M:System.Security.Cryptography.ECDiffieHellmanPublicKey.ToXmlString()
  • M:System.Security.Cryptography.ECDsaCng.FromXmlString(System.String, System.Security.Cryptography.ECKeyXmlFormat)
  • M:System.Security.Cryptography.ECDsaCng.ToXmlString(System.Security.Cryptography.ECKeyXmlFormat)

Activity

  1. added
    breaking-change
    on Mar 28, 2022
  2. added
    ⌚ Not Triaged
    🏁 Release: .NET 7
    source incompatible
    on Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 7breaking-changesource incompatible

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions