-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
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)