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