if (_cngKey != null)
{
_cngKey.Dispose();
- _cngKey = null;
+ _cngKey = null!;
}
}
}
}
- private CngKey? _cngKey;
+ private CngKey _cngKey;
private readonly bool _encrypting;
private static readonly CngProperty s_ECBMode =
out byte[]? allocated);
Debug.Assert(ret);
- Debug.Assert(allocated != null); // on account of allocate parameter being true
+ Debug.Assert(allocated != null); // since `allocate: true`
return allocated;
}
private CngKey GetKey()
{
- CngKey? key = null;
+ CngKey key;
if (_core.IsKeyGeneratedNamedCurve())
{
}
else
{
- CngAlgorithm? algorithm = null;
+ CngAlgorithm algorithm;
int keySize = 0;
// Map the current key size to a CNG algorithm name