private RSACryptoServiceProvider(int keySize, CspParameters parameters, bool useDefaultKeySize)
{
if (keySize < 0)
{
throw new ArgumentOutOfRangeException("dwKeySize", "ArgumentOutOfRange_NeedNonNegNum");
}
_parameters = CapiHelper.SaveCspParameters(
CapiHelper.CspAlgorithmType.Rsa,
parameters,
s_useMachineKeyStore,
out _randomKeyContainer);
_keySize = useDefaultKeySize ? 1024 : keySize;
// If this is not a random container we generate, create it eagerly
// in the constructor so we can report any errors now.
if (!_randomKeyContainer)
{
// Force-read the SafeKeyHandle property, which will summon it into existence.
SafeKeyHandle localHandle = SafeKeyHandle;
Debug.Assert(localHandle != null);
}
}