106 references to Advapi32
System.Security.Cryptography (106)
_generated\0\LibraryImports.g.cs (22)
86
internal static partial bool CryptCreateHash(global::System.Security.Cryptography.SafeProvHandle hProv, int Algid, global::System.Security.Cryptography.SafeCapiKeyHandle hKey, global::Interop.
Advapi32
.CryptCreateHashFlags dwFlags, out global::System.Security.Cryptography.SafeHashHandle phHash)
138
static extern unsafe int __PInvoke(nint __hProv_native, int __Algid_native, nint __hKey_native, global::Interop.
Advapi32
.CryptCreateHashFlags __dwFlags_native, nint* __phHash_native);
470
public static partial bool CryptGetDefaultProvider(int dwProvType, nint pdwReserved, global::Interop.
Advapi32
.GetDefaultProviderFlags dwFlags, char[] pszProvName, ref int pcbProvName)
490
static extern unsafe int __PInvoke(int __dwProvType_native, nint __pdwReserved_native, global::Interop.
Advapi32
.GetDefaultProviderFlags __dwFlags_native, char* __pszProvName_native, int* __pcbProvName_native);
499
public static partial bool CryptGetHashParam(global::System.Security.Cryptography.SafeHashHandle hHash, global::Interop.
Advapi32
.CryptHashProperty dwParam, out int pbData, ref int pdwDataLen, int dwFlags)
536
static extern unsafe int __PInvoke(nint __hHash_native, global::Interop.
Advapi32
.CryptHashProperty __dwParam_native, int* __pbData_native, int* __pdwDataLen_native, int __dwFlags_native);
545
public static partial bool CryptSetHashParam(global::System.Security.Cryptography.SafeHashHandle hHash, global::Interop.
Advapi32
.CryptHashProperty dwParam, byte[] buffer, int dwFlags)
580
static extern unsafe int __PInvoke(nint __hHash_native, global::Interop.
Advapi32
.CryptHashProperty __dwParam_native, byte* __buffer_native, int __dwFlags_native);
589
public static partial bool CryptGetKeyParam(global::System.Security.Cryptography.SafeCapiKeyHandle hKey, global::Interop.
Advapi32
.CryptGetKeyParamFlags dwParam, byte[] pbData, ref int pdwDataLen, int dwFlags)
625
static extern unsafe int __PInvoke(nint __hKey_native, global::Interop.
Advapi32
.CryptGetKeyParamFlags __dwParam_native, byte* __pbData_native, int* __pdwDataLen_native, int __dwFlags_native);
634
public static partial bool CryptSetProvParam(global::System.Runtime.InteropServices.SafeHandle safeProvHandle, global::Interop.
Advapi32
.CryptProvParam dwParam, nint pbData, int dwFlags)
667
static extern unsafe int __PInvoke(nint __safeProvHandle_native, global::Interop.
Advapi32
.CryptProvParam __dwParam_native, nint __pbData_native, int __dwFlags_native);
676
public static partial bool CryptSetProvParam(global::System.Security.Cryptography.SafeProvHandle hProv, global::Interop.
Advapi32
.CryptProvParam dwParam, ref nint pbData, int dwFlags)
711
static extern unsafe int __PInvoke(nint __hProv_native, global::Interop.
Advapi32
.CryptProvParam __dwParam_native, nint* __pbData_native, int __dwFlags_native);
720
public static partial bool CryptGetProvParam(global::System.Runtime.InteropServices.SafeHandle safeProvHandle, global::Interop.
Advapi32
.CryptProvParam dwParam, nint pbData, ref int dwDataLen, int dwFlags)
755
static extern unsafe int __PInvoke(nint __safeProvHandle_native, global::Interop.
Advapi32
.CryptProvParam __dwParam_native, nint __pbData_native, int* __dwDataLen_native, int __dwFlags_native);
1039
public static partial bool CryptSignHash(global::System.Security.Cryptography.SafeHashHandle hHash, global::Interop.
Advapi32
.KeySpec dwKeySpec, string szDescription, global::Interop.
Advapi32
.CryptSignAndVerifyHashFlags dwFlags, byte[] pbSignature, ref int pdwSigLen)
1076
static extern unsafe int __PInvoke(nint __hHash_native, global::Interop.
Advapi32
.KeySpec __dwKeySpec_native, ushort* __szDescription_native, global::Interop.
Advapi32
.CryptSignAndVerifyHashFlags __dwFlags_native, byte* __pbSignature_native, int* __pdwSigLen_native);
1085
public static partial bool CryptVerifySignature(global::System.Security.Cryptography.SafeHashHandle hHash, byte[] pbSignature, int dwSigLen, global::System.Security.Cryptography.SafeCapiKeyHandle hPubKey, string szDescription, global::Interop.
Advapi32
.CryptSignAndVerifyHashFlags dwFlags)
1126
static extern unsafe int __PInvoke(nint __hHash_native, byte* __pbSignature_native, int __dwSigLen_native, nint __hPubKey_native, ushort* __szDescription_native, global::Interop.
Advapi32
.CryptSignAndVerifyHashFlags __dwFlags_native);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeHashHandle.cs (1)
53
bool successfullyFreed = Interop.
Advapi32
.CryptDestroyHash(handle);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeKeyHandle.cs (1)
88
bool successfullyFreed = Interop.
Advapi32
.CryptDestroyKey(handle);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeProvHandle.cs (5)
106
if (!_fPersistKeyInCsp && 0 == (_flags & (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT))
110
uint flags = (_flags & (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET) | (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_DELETEKEYSET;
112
_ = Interop.
Advapi32
.CryptAcquireContext(out hIgnoredProv, _containerName, _providerName, _type, flags);
118
bool successfullyFreed = Interop.
Advapi32
.CryptReleaseContext(handle, 0);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCertContextHandleWithKeyContainerDeletion.cs (1)
77
_ = Interop.
Advapi32
.CryptAcquireContext(out hProv, pProvInfo->pwszContainerName, pProvInfo->pwszProvName, pProvInfo->dwProvType, flags);
System\Security\Cryptography\CapiHelper.DSA.Windows.cs (1)
34
(uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT))
System\Security\Cryptography\CapiHelper.Windows.cs (72)
12
using CryptProvParam = Interop.
Advapi32
.CryptProvParam;
60
dwProvType, (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT))
83
if (!Interop.
Advapi32
.CryptGetDefaultProvider(dwType, IntPtr.Zero,
84
Interop.
Advapi32
.GetDefaultProviderFlags.CRYPT_MACHINE_DEFAULT,
93
if (!Interop.
Advapi32
.CryptGetDefaultProvider(dwType, IntPtr.Zero,
94
Interop.
Advapi32
.GetDefaultProviderFlags.CRYPT_MACHINE_DEFAULT,
120
uint dwFlags = (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_NEWKEYSET;
123
dwFlags |= (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT;
143
const uint VerifyContextFlag = (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT;
144
const uint MachineContextFlag = (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET;
157
if (!Interop.
Advapi32
.CryptAcquireContext(out safeProvHandle, keyContainer, providerName, providerType, flags))
182
int ret = OpenCSP(cspParameters, (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT, out hProv);
250
if (IsFlagBitSet(flags, (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT))
293
if (!Interop.
Advapi32
.CryptSetProvParam(safeProvHandle, CryptProvParam.PP_CLIENT_HWND, ref parentWindowHandle, 0))
306
(parameters.KeyNumber == (int)Interop.
Advapi32
.KeySpec.AT_SIGNATURE) ?
309
if (!Interop.
Advapi32
.CryptSetProvParam(safeProvHandle, param, password, 0))
344
if (!Interop.
Advapi32
.CryptGetProvParam(safeProvHandle, flags, impType, ref cb))
388
if (!Interop.
Advapi32
.CryptGetKeyParam(safeKeyHandle, Interop.
Advapi32
.CryptGetKeyParamFlags.KP_PERMISSIONS, permissions, ref cb, 0))
393
retVal = IsFlagBitSet((uint)permissionsReturn, (uint)Interop.
Advapi32
.CryptGetKeyParamFlags.CRYPT_EXPORT);
519
cspFlags |= (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET;
523
cspFlags |= (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_SILENT;
527
cspFlags |= (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT;
560
if (!Interop.
Advapi32
.CryptGetKeyParam(safeKeyHandle, Interop.
Advapi32
.CryptGetKeyParamFlags.KP_KEYLEN, null, ref cb, 0))
565
if (!Interop.
Advapi32
.CryptGetKeyParam(safeKeyHandle, Interop.
Advapi32
.CryptGetKeyParamFlags.KP_KEYLEN, pb, ref cb, 0))
580
if (!Interop.
Advapi32
.CryptGetKeyParam(safeKeyHandle, Interop.
Advapi32
.CryptGetKeyParamFlags.KP_ALGID, null, ref cb, 0))
585
if (!Interop.
Advapi32
.CryptGetKeyParam(safeKeyHandle, Interop.
Advapi32
.CryptGetKeyParamFlags.KP_ALGID, pb, ref cb, 0))
613
if (!Interop.
Advapi32
.CryptSetKeyParam(safeKeyHandle, (int)keyParam, value, 0))
638
if (!Interop.
Advapi32
.CryptSetKeyParam(safeKeyHandle, (int)keyParam, ref value, 0))
821
int dwFlags = fOAEP ? (int)Interop.
Advapi32
.CryptDecryptFlags.CRYPT_OAEP : 0;
823
if (!Interop.
Advapi32
.CryptDecrypt(safeKeyHandle, SafeHashHandle.InvalidHandle, true, dwFlags, dataToBeDecrypted, ref decryptedDataLength))
831
if ((uint)((uint)dwFlags & (uint)Interop.
Advapi32
.CryptDecryptFlags.CRYPT_OAEP) == (uint)Interop.
Advapi32
.CryptDecryptFlags.CRYPT_OAEP &&
877
int dwEncryptFlags = foep ? (int)Interop.
Advapi32
.CryptDecryptFlags.CRYPT_OAEP : 0;
880
if (!Interop.
Advapi32
.CryptEncrypt(safeKeyHandle, SafeHashHandle.InvalidHandle, true, dwEncryptFlags, null, ref cbEncryptedKey, cbEncryptedKey))
893
if (!Interop.
Advapi32
.CryptEncrypt(safeKeyHandle, SafeHashHandle.InvalidHandle, true, dwEncryptFlags, pbEncryptedKey, ref cbKey, cbEncryptedKey))
912
if (!Interop.
Advapi32
.CryptEncrypt(hKey, SafeHashHandle.InvalidHandle, isFinal, 0, null, ref cbEncryptedData, cbEncryptedData))
927
if (!Interop.
Advapi32
.CryptEncrypt(hKey, SafeHashHandle.InvalidHandle, isFinal, 0, encryptedData, ref encryptedDataLength, cbEncryptedData))
954
if (!Interop.
Advapi32
.CryptDecrypt(hKey, SafeHashHandle.InvalidHandle, false, 0, dataToBeDecrypted, ref decryptedDataLength))
1013
if (!Interop.
Advapi32
.CryptExportKey(safeKeyHandle, SafeCapiKeyHandle.InvalidHandle, dwBlobType, 0, null, ref cbRawData))
1019
if (!Interop.
Advapi32
.CryptExportKey(safeKeyHandle, SafeCapiKeyHandle.InvalidHandle, dwBlobType, 0, pbRawData, ref cbRawData))
1161
if (!Interop.
Advapi32
.CryptSignHash(hHash, (Interop.
Advapi32
.KeySpec)keyNumber, null, Interop.
Advapi32
.CryptSignAndVerifyHashFlags.None, null, ref cbSignature))
1168
if (!Interop.
Advapi32
.CryptSignHash(hHash, (Interop.
Advapi32
.KeySpec)keyNumber, null, Interop.
Advapi32
.CryptSignAndVerifyHashFlags.None, signature, ref cbSignature))
1218
bool verified = Interop.
Advapi32
.CryptVerifySignature(hHash, signature, signature.Length, hKey, null, Interop.
Advapi32
.CryptSignAndVerifyHashFlags.None);
1241
if (!CryptCreateHash(hProv, algidHash, SafeCapiKeyHandle.InvalidHandle, Interop.
Advapi32
.CryptCreateHashFlags.None, out hHash))
1248
if (!Interop.
Advapi32
.CryptHashData(hHash, password, cbPassword, 0))
1268
if (!Interop.
Advapi32
.CryptGetKeyParam(hKey, Interop.
Advapi32
.CryptGetKeyParamFlags.KP_IV, null, ref cbIV, 0))
1276
if (!Interop.
Advapi32
.CryptGetKeyParam(hKey, Interop.
Advapi32
.CryptGetKeyParamFlags.KP_IV, pbIV, ref cbIV, 0))
1316
if (!Interop.
Advapi32
.CryptExportKey(hKey, hPubKey, SIMPLEBLOB, 0, null, ref cbOut))
1324
if (!Interop.
Advapi32
.CryptExportKey(hKey, hPubKey, SIMPLEBLOB, 0, key_full, ref cbOut))
1376
if (!CryptCreateHash(hProv, calgHash, SafeCapiKeyHandle.InvalidHandle, Interop.
Advapi32
.CryptCreateHashFlags.None, out hHash))
1389
if (!Interop.
Advapi32
.CryptGetHashParam(hHash, Interop.
Advapi32
.CryptHashProperty.HP_HASHSIZE, out dwHashSize, ref cbHashSize, 0))
1405
if (!Interop.
Advapi32
.CryptSetHashParam(hHash, Interop.
Advapi32
.CryptHashProperty.HP_HASHVAL, hash, 0))
1437
bool response = Interop.
Advapi32
.CryptGetUserKey(safeProvHandle, dwKeySpec, out safeKeyHandle);
1450
bool response = Interop.
Advapi32
.CryptGenKey(safeProvHandle, algId, dwFlags, out safeKeyHandle);
1466
bool response = Interop.
Advapi32
.CryptImportKey(hProv, pbDataPtr, pbData.Length, hPubKey, dwFlags, out phKey);
1478
Interop.
Advapi32
.CryptCreateHashFlags dwFlags,
1481
bool response = Interop.
Advapi32
.CryptCreateHash(hProv, algId, hKey, dwFlags, out phHash);
1495
bool response = Interop.
Advapi32
.CryptDeriveKey(hProv, algId, phHash, dwFlags, out phKey);
System\Security\Cryptography\CspKeyContainerInfo.Windows.cs (2)
200
const uint SilentFlags = (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_SILENT;
235
const uint OpenDeviceFlags = (uint)Interop.
Advapi32
.CryptAcquireContextFlags.CRYPT_VERIFYCONTEXT;
System\Security\Cryptography\RSACryptoServiceProvider.Windows.cs (1)
666
if (_parameters.KeyNumber == (int)Interop.
Advapi32
.KeySpec.AT_KEYEXCHANGE)