Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Encrypt() [2/2]

byte[] System.Security.Cryptography.RSACryptoServiceProvider.Encrypt ( byte[] rgb,
bool fOAEP )
inline

Definition at line 242 of file RSACryptoServiceProvider.cs.

243 {
244 if (rgb == null)
245 {
246 throw new ArgumentNullException("rgb");
247 }
248 if (fOAEP)
249 {
250 int num = (KeySize + 7) / 8;
251 if (num - 42 < rgb.Length)
252 {
253 throw (-2146893820).ToCryptographicException();
254 }
255 }
256 byte[] pbEncryptedKey = null;
257 CapiHelper.EncryptKey(SafeKeyHandle, rgb, rgb.Length, fOAEP, ref pbEncryptedKey);
258 return pbEncryptedKey;
259 }
static void EncryptKey(SafeKeyHandle safeKeyHandle, byte[] pbKey, int cbKey, bool foep, [NotNull] ref byte[] pbEncryptedKey)

References Internal.NativeCrypto.CapiHelper.EncryptKey(), and System.Security.Cryptography.RSACryptoServiceProvider.KeySize.

Referenced by System.Security.Cryptography.RSACryptoServiceProvider.Encrypt().