public byte[] Decrypt(byte[] rgb, bool fOAEP)
{
if (rgb == null)
{
throw new ArgumentNullException(nameof(rgb));
}
// Save the KeySize value to a local because it has non-trivial cost.
int keySize = KeySize;
// size check -- must be at most the modulus size
if (rgb.Length > (keySize / 8))
{
throw new CryptographicException(SR.Format(SR.Cryptography_Padding_DecDataTooBig, Convert.ToString(keySize / 8)));
}
byte[] decryptedKey;
CapiHelper.DecryptKey(SafeKeyHandle, rgb, rgb.Length, fOAEP, out decryptedKey);
return decryptedKey;
}