RSA.EncryptValue(Byte[]) Method

Definition

Caution

RSA.EncryptValue and DecryptValue are not supported and throw NotSupportedException. Use RSA.Encrypt and RSA.Decrypt instead.

When overridden in a derived class, encrypts the input data using the public key.

C#
[System.Obsolete("RSA.EncryptValue and DecryptValue are not supported and throw NotSupportedException. Use RSA.Encrypt and RSA.Decrypt instead.", DiagnosticId="SYSLIB0048", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual byte[] EncryptValue(byte[] rgb);
C#
public virtual byte[] EncryptValue(byte[] rgb);
C#
public abstract byte[] EncryptValue(byte[] rgb);

Parameters

rgb
Byte[]

The plain text to be encrypted.

Returns

Byte[]

The resulting encryption of the rgb parameter as cipher text.

Attributes

Exceptions

This method call is not supported. This exception is thrown starting with the .NET Framework 4.6.

Remarks

In the .NET Framework 4.5.2 and earlier versions of the .NET Framework, this method was abstract. However, the only implementation by a derived class, RSACryptoServiceProvider.DecryptValue, also threw a NotSupportedException exception.

Applies to

Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also