25 references to UnsafeNativeMethods
Microsoft.AspNetCore.Cryptography.Internal (25)
Cng\BCryptUtil.cs (2)
20int ntstatus = UnsafeNativeMethods.BCryptGenRandom( 25UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus);
Cng\OSVersionUtil.cs (1)
24using var bcryptLibHandle = SafeLibraryHandle.Open(UnsafeNativeMethods.BCRYPT_LIB);
SafeHandles\BCryptAlgorithmHandle.cs (7)
32int ntstatus = UnsafeNativeMethods.BCryptCreateHash(this, out retVal, IntPtr.Zero, 0, pbKey, cbKey, dwFlags: 0); 33UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus); 55int ntstatus = UnsafeNativeMethods.BCryptGenerateSymmetricKey(this, out retVal, IntPtr.Zero, 0, pbSecret, cbSecret, 0); 56UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus); 139int ntstatus = UnsafeNativeMethods.BCryptOpenAlgorithmProvider(out algHandle, algorithmId, implementation, dwFlags: (hmac) ? BCRYPT_ALG_HANDLE_HMAC_FLAG : 0); 147UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus); 156return (UnsafeNativeMethods.BCryptCloseAlgorithmProvider(handle, dwFlags: 0) == 0);
SafeHandles\BCryptHandle.cs (4)
18int ntstatus = UnsafeNativeMethods.BCryptGetProperty(this, pszProperty, pbOutput, cbOutput, out retVal, dwFlags: 0); 19UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus); 25int ntstatus = UnsafeNativeMethods.BCryptSetProperty(this, pszProperty, pbInput, cbInput, dwFlags: 0); 26UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus);
SafeHandles\BCryptHashHandle.cs (7)
21int ntstatus = UnsafeNativeMethods.BCryptDuplicateHash(this, out duplicateHandle, IntPtr.Zero, 0, 0); 22UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus); 37ntstatus = UnsafeNativeMethods.BCryptHashData( 42UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus); 45ntstatus = UnsafeNativeMethods.BCryptFinishHash( 50UnsafeNativeMethods.ThrowExceptionForBCryptStatus(ntstatus); 56return (UnsafeNativeMethods.BCryptDestroyHash(handle) == 0);
SafeHandles\BCryptKeyHandle.cs (1)
17return (UnsafeNativeMethods.BCryptDestroyKey(handle) == 0);
SafeHandles\NCryptDescriptorHandle.cs (3)
22int ntstatus = UnsafeNativeMethods.NCryptGetProtectionDescriptorInfo( 27UnsafeNativeMethods.ThrowExceptionForNCryptStatus(ntstatus); 39return (UnsafeNativeMethods.NCryptCloseProtectionDescriptor(handle) == 0);