public override DSAParameters ExportParameters(bool includePrivateParameters)
{
// It's entirely possible that this line will cause the key to be generated in the first place.
SafeDsaHandle key = _key.Value;
CheckInvalidKey(key);
DSAParameters dsaParameters = Interop.Crypto.ExportDsaParameters(key, includePrivateParameters);
bool hasPrivateKey = dsaParameters.X != null;
if (hasPrivateKey != includePrivateParameters)
throw new CryptographicException(SR.Cryptography_CSP_NoPrivateKey);
return dsaParameters;
}