189 references to Utils
mscorlib (189)
system\security\cryptography\cryptoapitransform.cs (15)
84_safeProvHandle = Utils.AcquireProvHandle(new CspParameters(Utils.DefaultRsaProviderType)); 88Utils._ImportBulkKey(_safeProvHandle, algid, useSalt, _rgbKey, ref safeKeyHandle); 96Utils.SetKeyParamRgb(_safeKeyHandle, _rgArgIds[i], rgbValue, rgbValue.Length); 103Utils.SetKeyParamDw(_safeKeyHandle, _rgArgIds[i], dwValue); 193Utils._EncryptData(_safeKeyHandle, EmptyArray<Byte>.Value, 0, 0, ref temp, 0, PaddingValue, true); 212return Utils._EncryptData(_safeKeyHandle, inputBuffer, inputOffset, inputCount, ref outputBuffer, outputOffset, PaddingValue, false); 218return Utils._DecryptData(_safeKeyHandle, inputBuffer, inputOffset, inputCount, ref outputBuffer, outputOffset, PaddingValue, false); 227return Utils._DecryptData(_safeKeyHandle, inputBuffer, inputOffset, inputToProcess, ref outputBuffer, outputOffset, PaddingValue, false); 230int r = Utils._DecryptData(_safeKeyHandle, _depadBuffer, 0, _depadBuffer.Length, ref outputBuffer, outputOffset, PaddingValue, false); 234r = Utils._DecryptData(_safeKeyHandle, inputBuffer, inputOffset, inputToProcess, ref outputBuffer, outputOffset, PaddingValue, false); 252Utils._EncryptData(_safeKeyHandle, inputBuffer, inputOffset, inputCount, ref transformedBytes, 0, PaddingValue, true); 261Utils._DecryptData(_safeKeyHandle, inputBuffer, inputOffset, inputCount, ref transformedBytes, 0, PaddingValue, true); 269Utils._DecryptData(_safeKeyHandle, temp, 0, temp.Length, ref transformedBytes, 0, PaddingValue, true); 365public CspParameters () : this(Utils.DefaultRsaProviderType, null, null) {}
system\security\cryptography\cryptoconfig.cs (2)
61if (Utils._GetEnforceFipsPolicySetting()) { 73s_fipsAlgorithmPolicy = Utils.ReadLegacyFipsPolicy();
system\security\cryptography\des.cs (2)
86byte[] rgbOddParityKey = Utils.FixupKeyParity(rgbKey); 101byte[] rgbOddParityKey = Utils.FixupKeyParity(rgbKey);
system\security\cryptography\descryptoserviceprovider.cs (6)
22if (!Utils.HasAlgorithm(Constants.CALG_DES, 0)) 54Utils.StaticRandomNumberGenerator.GetBytes(KeyValue); 57Utils.StaticRandomNumberGenerator.GetBytes(KeyValue); 63Utils.StaticRandomNumberGenerator.GetBytes(IVValue); 87Utils.StaticRandomNumberGenerator.GetBytes(rgbKey); 101Utils.StaticRandomNumberGenerator.GetBytes(rgbIV);
system\security\cryptography\dsa.cs (10)
168dsaParams.P = Convert.FromBase64String(Utils.DiscardWhiteSpaces(pString)); 175dsaParams.Q = Convert.FromBase64String(Utils.DiscardWhiteSpaces(qString)); 182dsaParams.G = Convert.FromBase64String(Utils.DiscardWhiteSpaces(gString)); 189dsaParams.Y = Convert.FromBase64String(Utils.DiscardWhiteSpaces(yString)); 193if (jString != null) dsaParams.J = Convert.FromBase64String(Utils.DiscardWhiteSpaces(jString)); 197if (xString != null) dsaParams.X = Convert.FromBase64String(Utils.DiscardWhiteSpaces(xString)); 203dsaParams.Seed = Convert.FromBase64String(Utils.DiscardWhiteSpaces(seedString)); 204dsaParams.Counter = Utils.ConvertByteArrayToInt(Convert.FromBase64String(Utils.DiscardWhiteSpaces(pgenCounterString))); 258sb.Append("<PgenCounter>"+Convert.ToBase64String(Utils.ConvertIntToByteArray(dsaParams.Counter))+"</PgenCounter>");
system\security\cryptography\dsacryptoserviceprovider.cs (16)
75_parameters = Utils.SaveCspParameters(CspAlgorithmType.Dss, parameters, s_UseMachineKeyStore, ref _randomKeyContainer); 95Utils.GetKeyPairHelper(CspAlgorithmType.Dss, _parameters, _randomKeyContainer, _dwKeySize, ref _safeProvHandle, ref _safeKeyHandle); 119byte[] publicKey = (byte[]) Utils._GetKeyParameter(_safeKeyHandle, Constants.CLR_PUBLICKEYONLY); 137byte[] keySize = (byte[]) Utils._GetKeyParameter(_safeKeyHandle, Constants.CLR_KEYLEN); 162_safeProvHandle = Utils.CreateProvHandle(_parameters, _randomKeyContainer); 165return Utils.GetPersistKeyInCsp(_safeProvHandle); 183Utils.SetPersistKeyInCsp(_safeProvHandle, value); 203Utils._ExportKey(_safeKeyHandle, blobType, dsaCspObject); 211return Utils.ExportCspBlobHelper(includePrivateParameters, _parameters, _safeKeyHandle); 224Utils._ImportKey(Utils.StaticDssProvHandle, Constants.CALG_DSS_SIGN, (CspProviderFlags) 0, dsaCspObject, ref _safeKeyHandle); 231_safeProvHandle = Utils.CreateProvHandle(_parameters, _randomKeyContainer); 233Utils._ImportKey(_safeProvHandle, Constants.CALG_DSS_SIGN, _parameters.Flags, dsaCspObject, ref _safeKeyHandle); 240Utils.ImportCspBlobHelper(CspAlgorithmType.Dss, keyBlob, IsPublic(keyBlob), ref _parameters, _randomKeyContainer, ref _safeProvHandle, ref _safeKeyHandle); 320return Utils.SignValue(_safeKeyHandle, _parameters.KeyNumber, Constants.CALG_DSS_SIGN, calgHash, rgbHash); 336return Utils.VerifySign(_safeKeyHandle, Constants.CALG_DSS_SIGN, calgHash, rgbHash, rgbSignature);
system\security\cryptography\hmacmd5.cs (1)
20public HMACMD5 () : this (Utils.GenerateRandom(64)) {}
system\security\cryptography\hmacripemd160.cs (1)
20public HMACRIPEMD160 () : this (Utils.GenerateRandom(64)) {}
system\security\cryptography\hmacsha1.cs (1)
20public HMACSHA1 () : this (Utils.GenerateRandom(64)) {}
system\security\cryptography\hmacsha256.cs (1)
20public HMACSHA256 () : this (Utils.GenerateRandom(64)) {}
system\security\cryptography\hmacsha384.cs (2)
17private bool m_useLegacyBlockSize = Utils._ProduceLegacyHmacValues(); 23public HMACSHA384 () : this (Utils.GenerateRandom(128)) {}
system\security\cryptography\hmacsha512.cs (2)
17private bool m_useLegacyBlockSize = Utils._ProduceLegacyHmacValues(); 23public HMACSHA512 () : this (Utils.GenerateRandom(128)) {}
system\security\cryptography\icspasymmetricalgorithm.cs (14)
80int hr = Utils._OpenCSP(m_parameters, Constants.CRYPT_SILENT, ref safeProvHandle); 84string uniqueContainerName = (string) Utils._GetProviderParameter(safeProvHandle, m_parameters.KeyNumber, Constants.CLR_UNIQUE_CONTAINER); 104int hr = Utils._OpenCSP(m_parameters, Constants.CRYPT_SILENT, ref safeProvHandle); 108byte[] isExportable = (byte[]) Utils._GetProviderParameter(safeProvHandle, m_parameters.KeyNumber, Constants.CLR_EXPORTABLE); 122int hr = Utils._OpenCSP(parameters, flags, ref safeProvHandle); 126byte[] isHardwareDevice = (byte[]) Utils._GetProviderParameter(safeProvHandle, parameters.KeyNumber, Constants.CLR_HARDWARE); 140int hr = Utils._OpenCSP(parameters, flags, ref safeProvHandle); 144byte[] isRemovable = (byte[]) Utils._GetProviderParameter(safeProvHandle, parameters.KeyNumber, Constants.CLR_REMOVABLE); 155int hr = Utils._OpenCSP(m_parameters, Constants.CRYPT_SILENT, ref safeProvHandle); 159byte[] isAccessible = (byte[]) Utils._GetProviderParameter(safeProvHandle, m_parameters.KeyNumber, Constants.CLR_ACCESSIBLE); 173int hr = Utils._OpenCSP(m_parameters, Constants.CRYPT_SILENT, ref safeProvHandle); 177byte[] isProtected = (byte[]) Utils._GetProviderParameter(safeProvHandle, m_parameters.KeyNumber, Constants.CLR_PROTECTED); 195int hr = Utils._OpenCSP(m_parameters, Constants.CRYPT_SILENT, ref safeProvHandle); 200return Utils.GetKeySetSecurityInfo(safeProvHandle, AccessControlSections.All);
system\security\cryptography\mactripledes.cs (1)
36Utils.StaticRandomNumberGenerator.GetBytes(KeyValue);
system\security\cryptography\md5cryptoserviceprovider.cs (6)
35_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5); 56_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5); 62Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize); 67return Utils.EndHash(_safeHashHandle);
system\security\cryptography\passwordderivebytes.cs (1)
44SafeProvHandle safeProvHandle = Utils.AcquireProvHandle(_cspParams);
system\security\cryptography\pkcs1maskgenerationmethod.cs (1)
50Utils.ConvertIntToByteArray(counter++, ref rgbCounter);
system\security\cryptography\rc2cryptoserviceprovider.cs (6)
42if (!Utils.HasAlgorithm(Constants.CALG_RC2, 0)) 91Utils.StaticRandomNumberGenerator.GetBytes(KeyValue); 97Utils.StaticRandomNumberGenerator.GetBytes(IVValue); 121Utils.StaticRandomNumberGenerator.GetBytes(rgbKey); 149Utils.StaticRandomNumberGenerator.GetBytes(rgbIV); 173if (!Utils.HasAlgorithm(Constants.CALG_RC2, keySizeValue))
system\security\cryptography\rfc2898derivebytes.cs (3)
71Utils.StaticRandomNumberGenerator.GetBytes(salt); 227byte[] INT_block = Utils.Int(m_block); 289SafeProvHandle safeProvHandle = Utils.AcquireProvHandle(m_cspParams);
system\security\cryptography\rijndaelmanaged.cs (4)
60KeyValue = Utils.GenerateRandom(KeySizeValue / 8); 64IVValue = Utils.GenerateRandom(BlockSizeValue / 8); 74rgbKey = Utils.GenerateRandom(KeySizeValue / 8); 83rgbIV = Utils.GenerateRandom(BlockSizeValue / 8);
system\security\cryptography\rijndaelmanagedtransform.cs (1)
449Utils.StaticRandomNumberGenerator.GetBytes(padBytes);
system\security\cryptography\ripemd160managed.cs (2)
162Utils.DWORDToLittleEndian (hash, _stateMD160, 5); 183Utils.DWORDFromLittleEndian (blockDWords, 16, block);
system\security\cryptography\rngcryptoserviceprovider.cs (2)
56m_safeProvHandle = Utils.AcquireProvHandle(cspParams); 60m_safeProvHandle = Utils.StaticProvHandle;
system\security\cryptography\rsa.cs (8)
277rsaParams.Modulus = Convert.FromBase64String(Utils.DiscardWhiteSpaces(modulusString)); 284rsaParams.Exponent = Convert.FromBase64String(Utils.DiscardWhiteSpaces(exponentString)); 288if (pString != null) rsaParams.P = Convert.FromBase64String(Utils.DiscardWhiteSpaces(pString)); 292if (qString != null) rsaParams.Q = Convert.FromBase64String(Utils.DiscardWhiteSpaces(qString)); 296if (dpString != null) rsaParams.DP = Convert.FromBase64String(Utils.DiscardWhiteSpaces(dpString)); 300if (dqString != null) rsaParams.DQ = Convert.FromBase64String(Utils.DiscardWhiteSpaces(dqString)); 304if (inverseQString != null) rsaParams.InverseQ = Convert.FromBase64String(Utils.DiscardWhiteSpaces(inverseQString)); 308if (dString != null) rsaParams.D = Convert.FromBase64String(Utils.DiscardWhiteSpaces(dString));
system\security\cryptography\rsacryptoserviceprovider.cs (34)
85: this(0, new CspParameters(Utils.DefaultRsaProviderType, null, null, s_UseMachineKeyStore), true) { 92: this(dwKeySize, new CspParameters(Utils.DefaultRsaProviderType, null, null, s_UseMachineKeyStore), false) { 115_parameters = Utils.SaveCspParameters(CspAlgorithmType.Rsa, parameters, s_UseMachineKeyStore, ref _randomKeyContainer); 140Utils.GetKeyPairHelper(CspAlgorithmType.Rsa, _parameters, _randomKeyContainer, _dwKeySize, ref _safeProvHandle, ref _safeKeyHandle); 166byte[] publicKey = (byte[]) Utils._GetKeyParameter(_safeKeyHandle, Constants.CLR_PUBLICKEYONLY); 184byte[] keySize = (byte[]) Utils._GetKeyParameter(_safeKeyHandle, Constants.CLR_KEYLEN); 213_safeProvHandle = Utils.CreateProvHandle(_parameters, _randomKeyContainer); 216return Utils.GetPersistKeyInCsp(_safeProvHandle); 236Utils.SetPersistKeyInCsp(_safeProvHandle, value); 258Utils._ExportKey(_safeKeyHandle, blobType, rsaCspObject); 270return Utils.ExportCspBlobHelper(includePrivateParameters, _parameters, _safeKeyHandle); 286Utils._ImportKey(Utils.StaticProvHandle, Constants.CALG_RSA_KEYX, (CspProviderFlags) 0, rsaCspObject, ref _safeKeyHandle); 295_safeProvHandle = Utils.CreateProvHandle(_parameters, _randomKeyContainer); 297Utils._ImportKey(_safeProvHandle, Constants.CALG_RSA_KEYX, _parameters.Flags, rsaCspObject, ref _safeKeyHandle); 308Utils.ImportCspBlobHelper(CspAlgorithmType.Rsa, keyBlob, IsPublic(keyBlob), ref _parameters, _randomKeyContainer, ref _safeProvHandle, ref _safeKeyHandle); 312int calgHash = Utils.ObjToAlgId(halg, OidGroup.HashAlgorithm); 313HashAlgorithm hash = Utils.ObjToHashAlgorithm(halg); 319int calgHash = Utils.ObjToAlgId(halg, OidGroup.HashAlgorithm); 320HashAlgorithm hash = Utils.ObjToHashAlgorithm(halg); 326int calgHash = Utils.ObjToAlgId(halg, OidGroup.HashAlgorithm); 327HashAlgorithm hash = Utils.ObjToHashAlgorithm(halg); 333int calgHash = Utils.ObjToAlgId(halg, OidGroup.HashAlgorithm); 334HashAlgorithm hash = Utils.ObjToHashAlgorithm(halg); 363return Utils.SignValue(_safeKeyHandle, _parameters.KeyNumber, Constants.CALG_RSA_SIGN, calgHash, rgbHash); 384return Utils.VerifySign(_safeKeyHandle, Constants.CALG_RSA_SIGN, calgHash, rgbHash, rgbSignature); 527using (SafeHashHandle hashHandle = Utils.CreateHash(Utils.StaticProvHandle, GetAlgorithmId(hashAlgorithm))) { 528Utils.HashData(hashHandle, data, offset, count); 529return Utils.EndHash(hashHandle); 539using (SafeHashHandle hashHandle = Utils.CreateHash(Utils.StaticProvHandle, GetAlgorithmId(hashAlgorithm))) { 546Utils.HashData(hashHandle, buffer, 0, bytesRead); 550return Utils.EndHash(hashHandle);
system\security\cryptography\rsaoaepkeyexchangedeformatter.cs (2)
49return Utils.RsaOaepDecrypt(_rsaKey, SHA1.Create(), new PKCS1MaskGenerationMethod(), rgbData); 64_rsaOverridesDecrypt = Utils.DoesRsaKeyOverride(_rsaKey, "Decrypt", new Type[] { typeof(byte[]), typeof(RSAEncryptionPadding) });
system\security\cryptography\rsaoaepkeyexchangeformatter.cs (2)
79return Utils.RsaOaepEncrypt(_rsaKey, SHA1.Create(), new PKCS1MaskGenerationMethod(), RandomNumberGenerator.Create(), rgbData); 90_rsaOverridesEncrypt = Utils.DoesRsaKeyOverride(_rsaKey, "Encrypt", new Type[] { typeof(byte[]), typeof(RSAEncryptionPadding) });
system\security\cryptography\rsapkcs1keyexchangedeformatter.cs (1)
93_rsaOverridesDecrypt = Utils.DoesRsaKeyOverride(_rsaKey, "Decrypt", new Type[] { typeof(byte[]), typeof(RSAEncryptionPadding) });
system\security\cryptography\rsapkcs1keyexchangeformatter.cs (1)
105_rsaOverridesEncrypt = Utils.DoesRsaKeyOverride(_rsaKey, "Encrypt", new Type[] { typeof(byte[]), typeof(RSAEncryptionPadding) });
system\security\cryptography\rsapkcs1signaturedeformatter.cs (4)
81HashAlgorithmName hashAlgorithmName = Utils.OidToHashAlgorithmName(_strOID); 87byte[] pad = Utils.RsaPkcs1Padding(_rsaKey, CryptoConfig.EncodeOID(_strOID), rgbHash); 90return Utils.CompareBigIntArrays(_rsaKey.EncryptValue(rgbSignature), pad); 97_rsaOverridesVerifyHash = Utils.DoesRsaKeyOverride(_rsaKey, "VerifyHash", new Type[] { typeof(byte[]), typeof(byte[]), typeof(HashAlgorithmName), typeof(RSASignaturePadding) });
system\security\cryptography\rsapkcs1signatureformatter.cs (3)
72HashAlgorithmName hashAlgorithmName = Utils.OidToHashAlgorithmName(_strOID); 78byte[] pad = Utils.RsaPkcs1Padding(_rsaKey, CryptoConfig.EncodeOID(_strOID), rgbHash); 87_rsaOverridesSignHash = Utils.DoesRsaKeyOverride(_rsaKey, "SignHash", new Type[] { typeof(byte[]), typeof(HashAlgorithmName), typeof(RSASignaturePadding) });
system\security\cryptography\sha1cryptoserviceprovider.cs (6)
27_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); 49_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); 55Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize); 61return Utils.EndHash(_safeHashHandle);
system\security\cryptography\sha1managed.cs (2)
205Utils.DWORDToBigEndian (hash, _stateSHA1, 5); 222Utils.DWORDFromBigEndian(expandedBuffer, 16, block);
system\security\cryptography\sha256managed.cs (2)
203Utils.DWORDToBigEndian (hash, _stateSHA256, 8); 245Utils.DWORDFromBigEndian(expandedBuffer, 16, block);
system\security\cryptography\sha384managed.cs (2)
214Utils.QuadWordToBigEndian (hash, _stateSHA384, 6); 260Utils.QuadWordFromBigEndian (expandedBuffer, 16, block);
system\security\cryptography\sha512managed.cs (2)
207Utils.QuadWordToBigEndian (hash, _stateSHA512, 8); 253Utils.QuadWordFromBigEndian (expandedBuffer, 16, block);
system\security\cryptography\tripledes.cs (1)
84byte[] rgbOddParityKey = Utils.FixupKeyParity(rgbKey);
system\security\cryptography\tripledescryptoserviceprovider.cs (6)
22if (!Utils.HasAlgorithm(Constants.CALG_3DES, 0)) 48Utils.StaticRandomNumberGenerator.GetBytes(KeyValue); 51Utils.StaticRandomNumberGenerator.GetBytes(KeyValue); 58Utils.StaticRandomNumberGenerator.GetBytes(IVValue); 83Utils.StaticRandomNumberGenerator.GetBytes(rgbKey); 97Utils.StaticRandomNumberGenerator.GetBytes(rgbIV);
system\security\cryptography\utils.cs (13)
199Utils._AcquireCSP(parameters, ref safeProvHandle); 208int hr = Utils._OpenCSP(parameters, 0, ref safeProvHandle); 222Utils._CreateCSP(parameters, randomKeyContainer, ref safeProvHandle); 345Utils.ExportCspBlob(safeKeyHandle, includePrivateParameters ? Constants.PRIVATEKEYBLOB : Constants.PUBLICKEYBLOB, JitHelpers.GetObjectHandleOnStack(ref blob)); 353SafeProvHandle TempFetchedProvHandle = Utils.CreateProvHandle(parameters, randomKeyContainer); 398int hr = Utils._GetUserKey(safeProvHandle, parameters.KeyNumber, ref TempFetchedKeyHandle); 403Utils._GenerateKey(safeProvHandle, parameters.KeyNumber, parameters.Flags, dwKeySize, ref TempFetchedKeyHandle); 407byte[] algid = (byte[]) Utils._GetKeyParameter(TempFetchedKeyHandle, Constants.CLR_ALGID); 426parameters.KeyNumber = Utils._ImportCspBlob(keyBlob, keyType == CspAlgorithmType.Dss ? Utils.StaticDssProvHandle : Utils.StaticProvHandle, (CspProviderFlags) 0, ref safeKeyHandle); 435safeProvHandle = Utils.CreateProvHandle(parameters, randomKeyContainer); 436parameters.KeyNumber = Utils._ImportCspBlob(keyBlob, safeProvHandle, parameters.Flags, ref safeKeyHandle);