Decrypt Method

RSACryptoServiceProvider.Decrypt Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Decrypts data with the RSA algorithm.

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public byte[] Decrypt(
	byte[] rgb,
	bool fOAEP
)

Parameters

rgb
Type: System.Byte []
The data to be decrypted.
fOAEP
Type: System.Boolean
true to perform direct RSA decryption using OAEP padding; otherwise, false to use PKCS#1 v1.5 padding.

Return Value

Type: System.Byte []
The decrypted data, which is the original plain text before encryption.

ExceptionCondition
CryptographicException

The cryptographic service provider (CSP) cannot be acquired.

-or-

The fOAEP parameter is true and the length of the rgb parameter is greater than KeySize.

-or-

The fOAEP parameter is true and OAEP is not supported.

ArgumentNullException

rgb is null.

Use Encrypt to encrypt data for decryption with this method.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft