RSA.EncryptValue and RSA.DecryptValue are obsolete

The following methods are obsolete in .NET 8 (and later versions):

All references to these methods will result in a SYSLIB0048 warning at compile time.

Previous behavior

Previously, code could call the affected methods without any compilation warnings. However, they threw a NotSupportedException at run time.

New behavior

Starting in .NET 8, calling the affected methods produces a SYSLIB0048 compilation warning.

Version introduced

.NET 8 Preview 1

Type of breaking change

This change can affect source compatibility.

Reason for change

The affected methods were never implemented and always threw a NotSupportedException. Since the purpose of these methods is unclear and they shouldn't be called, they were marked as obsolete.

To encrypt or decrypt with RSA, use RSA.Encrypt or RSA.Decrypt instead.

Affected APIs