RSACryptoServiceProvider.Encrypt Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Encrypts data with the RSA algorithm.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- rgb
- Type:
System.Byte
[]
The data to be encrypted.
- fOAEP
- Type: System.Boolean
true to perform direct RSA encryption using OAEP padding; otherwise, false to use PKCS#1 v1.5 padding.
| Exception | Condition |
|---|---|
| CryptographicException | The cryptographic service provider (CSP) cannot be acquired. -or- The length of the rgb parameter is greater than the maximum allowed length. -or- The fOAEP parameter is true and OAEP padding is not supported. |
| ArgumentNullException | rgb is null. |
Show: