49 if (
value != safeProvHandle)
51 if (safeProvHandle !=
null)
86 if (
value != safeKeyHandle)
95 [SupportedOSPlatform(
"windows")]
129 if (
value != persistKeyInCsp)
141 return keyParameter[0] == 1;
171 [SupportedOSPlatform(
"windows")]
173 : this(0, parameters)
177 [SupportedOSPlatform(
"windows")]
193 protected override void Dispose(
bool disposing)
207 base.Dispose(disposing);
218 byte[] cspPublicBlob =
null;
219 if (includePrivateParameters)
222 if (keyBlobHeaderVersion <= 2)
224 cspPublicBlob =
ExportCspBlob(includePrivateParameters:
false);
227 return cspBlob.ToDSAParameters(includePrivateParameters, cspPublicBlob);
233 return safeProvHandle;
255 byte[] keyBlob = parameters.ToKeyBlob();
262 base.ImportEncryptedPkcs8PrivateKey(passwordBytes,
source, out bytesRead);
268 base.ImportEncryptedPkcs8PrivateKey(password,
source, out bytesRead);
292 return VerifyHash(rgbHash,
null, rgbSignature);
302 return VerifyHash(rgbHash,
null, rgbSignature);
347 if (rgbSignature ==
null)
365 if ((keyBlob[11] != 49 && keyBlob[11] != 51) || keyBlob[10] != 83 || keyBlob[9] != 83 || keyBlob[8] != 68)
static void AcquireCsp(CspParameters cspParameters, out SafeProvHandle safeProvHandle)
static SafeKeyHandle GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, int keySize, SafeProvHandle safeProvHandle)
static bool GetPersistKeyInCsp(SafeProvHandle safeProvHandle)
static void SetPersistKeyInCsp(SafeProvHandle safeProvHandle, bool fPersistKeyInCsp)
static SafeProvHandle CreateProvHandle(CspParameters parameters, bool randomKeyContainer)
static CspParameters SaveCspParameters(CspAlgorithmType keyType, CspParameters userParameters, CspProviderFlags defaultFlags, out bool randomKeyContainer)
static byte GetKeyBlobHeaderVersion(byte[] cspBlob)
static int NameOrOidToHashAlgId(string nameOrOid, OidGroup oidGroup)
static void ImportKeyBlob(SafeProvHandle saveProvHandle, CspProviderFlags flags, bool addNoSaltFlag, byte[] keyBlob, out SafeKeyHandle safeKeyHandle)
static byte[] SignValue(SafeProvHandle hProv, SafeKeyHandle hKey, int keyNumber, int calgKey, int calgHash, byte[] hash)
static byte[] ExportKeyBlob(bool includePrivateParameters, SafeKeyHandle safeKeyHandle)
static byte[] GetKeyParameter(SafeKeyHandle safeKeyHandle, int keyParam)
static bool VerifySign(SafeProvHandle hProv, SafeKeyHandle hKey, int calgKey, int calgHash, byte[] hash, byte[] signature)
static int ReadInt32LittleEndian(ReadOnlySpan< byte > source)
static string Cryptography_UnknownHashAlgorithm
static string Cryptography_InvalidHashSize
static string Format(string resourceFormat, object p1)
static string Cryptography_CSP_NoPrivateKey
static string ArgumentOutOfRange_NeedNonNegNum
override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
readonly bool _randomKeyContainer
byte[] SignData(Stream inputStream)
DSACryptoServiceProvider(int dwKeySize, CspParameters? parameters)
override void Dispose(bool disposing)
SafeKeyHandle _safeKeyHandle
SafeKeyHandle SafeKeyHandle
SafeProvHandle _safeProvHandle
override KeySizes[] LegalKeySizes
DSACryptoServiceProvider()
static bool IsPublic(byte[] keyBlob)
void ImportCspBlob(byte[] keyBlob)
byte[] ExportCspBlob(bool includePrivateParameters)
override string SignatureAlgorithm
static bool UseMachineKeyStore
CspKeyContainerInfo CspKeyContainerInfo
override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
override byte[] CreateSignature(byte[] rgbHash)
override? string KeyExchangeAlgorithm
override void ImportEncryptedPkcs8PrivateKey(ReadOnlySpan< char > password, ReadOnlySpan< byte > source, out int bytesRead)
readonly CspParameters _parameters
bool VerifyData(byte[] rgbData, byte[] rgbSignature)
override void ImportEncryptedPkcs8PrivateKey(ReadOnlySpan< byte > passwordBytes, ReadOnlySpan< byte > source, out int bytesRead)
byte[] SignHash(byte[] rgbHash, string? str)
static volatile CspProviderFlags s_useMachineKeyStore
DSACryptoServiceProvider(int dwKeySize)
override void ImportParameters(DSAParameters parameters)
byte[] SignData(byte[] buffer, int offset, int count)
SafeProvHandle AcquireSafeProviderHandle()
DSACryptoServiceProvider(CspParameters? parameters)
bool VerifyHash(byte[] rgbHash, string? str, byte[] rgbSignature)
byte[] SignData(byte[] buffer)
override DSAParameters ExportParameters(bool includePrivateParameters)
override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm)
byte[] ComputeHash(byte[] buffer)
override void Dispose(bool disposing)
override void Dispose(bool disposing)
static HashAlgorithmName SHA1