231 references to NCrypt
System.Security.Cryptography (231)
_generated\0\LibraryImports.g.cs (88)
4885
internal static unsafe partial global::Interop.
NCrypt
.ErrorCode NCryptEncrypt(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, global::System.ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, global::System.Span<byte> pbOutput, int cbOutput, out int pcbResult, global::Interop.
NCrypt
.AsymmetricPaddingMode dwFlags)
4889
global::Interop.
NCrypt
.ErrorCode __retVal = default;
4915
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, byte* __pbInput_native, int __cbInput_native, void* __pPaddingInfo_native, byte* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, global::Interop.
NCrypt
.AsymmetricPaddingMode __dwFlags_native);
4924
internal static unsafe partial global::Interop.
NCrypt
.ErrorCode NCryptDecrypt(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, global::System.ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, global::System.Span<byte> pbOutput, int cbOutput, out int pcbResult, global::Interop.
NCrypt
.AsymmetricPaddingMode dwFlags)
4928
global::Interop.
NCrypt
.ErrorCode __retVal = default;
4954
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, byte* __pbInput_native, int __cbInput_native, void* __pPaddingInfo_native, byte* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, global::Interop.
NCrypt
.AsymmetricPaddingMode __dwFlags_native);
4963
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptOpenKey(global::Microsoft.Win32.SafeHandles.SafeNCryptProviderHandle hProvider, out global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle phKey, string pszKeyName, int dwLegacyKeySpec, global::System.Security.Cryptography.CngKeyOpenOptions dwFlags)
4969
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5006
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hProvider_native, nint* __phKey_native, ushort* __pszKeyName_native, int __dwLegacyKeySpec_native, global::System.Security.Cryptography.CngKeyOpenOptions __dwFlags_native);
5015
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptImportKey(global::Microsoft.Win32.SafeHandles.SafeNCryptProviderHandle hProvider, nint hImportKey, string pszBlobType, nint pParameterList, out global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags)
5021
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5059
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hProvider_native, nint __hImportKey_native, ushort* __pszBlobType_native, nint __pParameterList_native, nint* __phKey_native, byte* __pbData_native, int __cbData_native, int __dwFlags_native);
5068
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptImportKey(global::Microsoft.Win32.SafeHandles.SafeNCryptProviderHandle hProvider, nint hImportKey, string pszBlobType, ref global::Interop.
NCrypt
.NCryptBufferDesc pParameterList, out global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags)
5074
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5084
fixed (global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native = &pParameterList)
5113
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hProvider_native, nint __hImportKey_native, ushort* __pszBlobType_native, global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native, nint* __phKey_native, byte* __pbData_native, int __cbData_native, int __dwFlags_native);
5122
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptExportKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, nint hExportKey, string pszBlobType, nint pParameterList, byte[] pbOutput, int cbOutput, out int pcbResult, int dwFlags)
5126
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5152
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, nint __hExportKey_native, ushort* __pszBlobType_native, nint __pParameterList_native, byte* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, int __dwFlags_native);
5161
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptExportKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, nint hExportKey, string pszBlobType, nint pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags)
5165
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5191
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, nint __hExportKey_native, ushort* __pszBlobType_native, nint __pParameterList_native, byte* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, int __dwFlags_native);
5200
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptExportKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, nint hExportKey, string pszBlobType, nint pParameterList, global::System.Span<byte> pbOutput, int cbOutput, out int pcbResult, int dwFlags)
5204
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5230
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, nint __hExportKey_native, ushort* __pszBlobType_native, nint __pParameterList_native, byte* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, int __dwFlags_native);
5239
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptExportKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, nint hExportKey, string pszBlobType, ref global::Interop.
NCrypt
.NCryptBufferDesc pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags)
5243
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5253
fixed (global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native = &pParameterList)
5270
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, nint __hExportKey_native, ushort* __pszBlobType_native, global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native, byte* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, int __dwFlags_native);
5279
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptDeleteKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, int dwFlags)
5282
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5304
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, int __dwFlags_native);
5313
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptCreatePersistedKey(global::Microsoft.Win32.SafeHandles.SafeNCryptProviderHandle hProvider, out global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle phKey, string pszAlgId, string pszKeyName, int dwLegacyKeySpec, global::System.Security.Cryptography.CngKeyCreationOptions dwFlags)
5319
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5357
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hProvider_native, nint* __phKey_native, ushort* __pszAlgId_native, ushort* __pszKeyName_native, int __dwLegacyKeySpec_native, global::System.Security.Cryptography.CngKeyCreationOptions __dwFlags_native);
5366
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptFinalizeKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, int dwFlags)
5369
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5391
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, int __dwFlags_native);
5400
private static unsafe partial global::Interop.
NCrypt
.ErrorCode NCryptDecapsulate(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, byte* pbCipherText, uint cbCipherText, byte* pbSecretKey, uint cbSecretKey, out uint pcbSecretKey, uint dwFlags)
5404
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5428
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, byte* __pbCipherText_native, uint __cbCipherText_native, byte* __pbSecretKey_native, uint __cbSecretKey_native, uint* __pcbSecretKey_native, uint __dwFlags_native);
5437
private static unsafe partial global::Interop.
NCrypt
.ErrorCode NCryptEncapsulate(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, byte* pbSecretKey, uint cbSecretKey, out uint pcbSecretKey, byte* pbCipherText, uint cbCipherText, out uint pcbCipherText, uint dwFlags)
5442
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5467
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, byte* __pbSecretKey_native, uint __cbSecretKey_native, uint* __pcbSecretKey_native, byte* __pbCipherText_native, uint __cbCipherText_native, uint* __pcbCipherText_native, uint __dwFlags_native);
5476
private static partial global::Interop.
NCrypt
.ErrorCode NCryptDeriveKey(global::Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle hSharedSecret, string pwszKDF, ref global::Interop.
NCrypt
.NCryptBufferDesc pParameterList, byte[] pbDerivedKey, int cbDerivedKey, out int pcbResult, global::Interop.
NCrypt
.SecretAgreementFlags dwFlags)
5480
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5490
fixed (global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native = &pParameterList)
5507
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hSharedSecret_native, ushort* __pwszKDF_native, global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native, byte* __pbDerivedKey_native, int __cbDerivedKey_native, int* __pcbResult_native, global::Interop.
NCrypt
.SecretAgreementFlags __dwFlags_native);
5516
private static partial global::Interop.
NCrypt
.ErrorCode NCryptDeriveKey(global::Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle hSharedSecret, string pwszKDF, nint pParameterList, global::System.Span<byte> pbDerivedKey, int cbDerivedKey, out int pcbResult, global::Interop.
NCrypt
.SecretAgreementFlags dwFlags)
5520
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5546
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hSharedSecret_native, ushort* __pwszKDF_native, nint __pParameterList_native, byte* __pbDerivedKey_native, int __cbDerivedKey_native, int* __pcbResult_native, global::Interop.
NCrypt
.SecretAgreementFlags __dwFlags_native);
5555
private static partial global::Interop.
NCrypt
.ErrorCode NCryptSecretAgreement(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hPrivKey, global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hPubKey, out global::Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle phSecret, int dwFlags)
5562
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5601
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hPrivKey_native, nint __hPubKey_native, nint* __phSecret_native, int __dwFlags_native);
5610
internal static extern partial global::Interop.
NCrypt
.ErrorCode NCryptFreeObject(nint hObject);
5618
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptOpenStorageProvider(out global::Microsoft.Win32.SafeHandles.SafeNCryptProviderHandle phProvider, string pszProviderName, int dwFlags)
5623
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5652
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint* __phProvider_native, ushort* __pszProviderName_native, int __dwFlags_native);
5661
internal static unsafe partial global::Interop.
NCrypt
.ErrorCode NCryptGetProperty(global::Microsoft.Win32.SafeHandles.SafeNCryptHandle hObject, string pszProperty, void* pbOutput, int cbOutput, out int pcbResult, global::System.Security.Cryptography.CngPropertyOptions dwFlags)
5665
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5690
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hObject_native, ushort* __pszProperty_native, void* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, global::System.Security.Cryptography.CngPropertyOptions __dwFlags_native);
5699
internal static unsafe partial global::Interop.
NCrypt
.ErrorCode NCryptSetProperty(global::Microsoft.Win32.SafeHandles.SafeNCryptHandle hObject, string pszProperty, void* pbInput, int cbInput, global::System.Security.Cryptography.CngPropertyOptions dwFlags)
5702
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5726
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hObject_native, ushort* __pszProperty_native, void* __pbInput_native, int __cbInput_native, global::System.Security.Cryptography.CngPropertyOptions __dwFlags_native);
5735
private static unsafe partial global::Interop.
NCrypt
.ErrorCode NCryptSignHash(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, void* pPaddingInfo, byte* pbHashValue, int cbHashValue, byte* pbSignature, int cbSignature, out int pcbResult, global::Interop.
NCrypt
.AsymmetricPaddingMode dwFlags)
5739
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5763
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, void* __pPaddingInfo_native, byte* __pbHashValue_native, int __cbHashValue_native, byte* __pbSignature_native, int __cbSignature_native, int* __pcbResult_native, global::Interop.
NCrypt
.AsymmetricPaddingMode __dwFlags_native);
5772
private static unsafe partial global::Interop.
NCrypt
.ErrorCode NCryptVerifySignature(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, void* pPaddingInfo, byte* pbHashValue, int cbHashValue, byte* pbSignature, int cbSignature, global::Interop.
NCrypt
.AsymmetricPaddingMode dwFlags)
5775
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5797
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, void* __pPaddingInfo_native, byte* __pbHashValue_native, int __cbHashValue_native, byte* __pbSignature_native, int __cbSignature_native, global::Interop.
NCrypt
.AsymmetricPaddingMode __dwFlags_native);
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (2)
10
using ErrorCode = Interop.
NCrypt
.ErrorCode;
339
ErrorCode errorCode = Interop.
NCrypt
.NCryptFreeObject(handle);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.ErrorCode.cs (3)
27
internal static bool IsBufferTooSmall(this
NCrypt
.ErrorCode errorCode)
29
return errorCode is
NCrypt
.ErrorCode.NTE_BUFFER_TOO_SMALL or
NCrypt
.ErrorCode.TPM_E_PCP_BUFFER_TOO_SMALL;
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.Properties.cs (2)
37
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetProperty(
60
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetProperty(
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (27)
9
using ErrorCode = Interop.
NCrypt
.ErrorCode;
15
internal static CryptographicException ToCryptographicException(this Interop.
NCrypt
.ErrorCode errorCode)
22
ErrorCode errorCode = Interop.
NCrypt
.NCryptOpenStorageProvider(
40
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(
66
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetProperty(
88
errorCode = Interop.
NCrypt
.NCryptGetProperty(
152
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(handle, IntPtr.Zero, blobType, IntPtr.Zero, null, 0, out numBytesNeeded, 0);
162
errorCode = Interop.
NCrypt
.NCryptExportKey(handle, IntPtr.Zero, blobType, IntPtr.Zero, buffer, buffer.Length, out numBytesNeeded, 0);
187
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(
208
errorCode = Interop.
NCrypt
.NCryptExportKey(
241
Interop.
NCrypt
.NCryptBuffer* buffers = stackalloc Interop.
NCrypt
.NCryptBuffer[3];
243
Interop.
NCrypt
.PBE_PARAMS pbeParams = default;
244
Span<byte> salt = new Span<byte>(pbeParams.rgbSalt, Interop.
NCrypt
.PBE_PARAMS.RgbSaltSize);
249
buffers[0] = new Interop.
NCrypt
.NCryptBuffer
251
BufferType = Interop.
NCrypt
.BufferType.PkcsSecret,
261
buffers[1] = new Interop.
NCrypt
.NCryptBuffer
263
BufferType = Interop.
NCrypt
.BufferType.PkcsAlgOid,
268
buffers[2] = new Interop.
NCrypt
.NCryptBuffer
270
BufferType = Interop.
NCrypt
.BufferType.PkcsAlgParam,
271
cbBuffer = sizeof(Interop.
NCrypt
.PBE_PARAMS),
275
Interop.
NCrypt
.NCryptBufferDesc desc = new Interop.
NCrypt
.NCryptBufferDesc
284
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(
287
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
312
errorCode = Interop.
NCrypt
.NCryptExportKey(
315
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.SignVerify.cs (11)
6
using AsymmetricPaddingMode = Interop.
NCrypt
.AsymmetricPaddingMode;
7
using ErrorCode = Interop.
NCrypt
.ErrorCode;
22
ErrorCode errorCode = Interop.
NCrypt
.NCryptSignHash(keyHandle, pPaddingInfo, hash, signature, out numBytesNeeded, paddingMode);
26
errorCode = Interop.
NCrypt
.NCryptSignHash(keyHandle, pPaddingInfo, hash, signature, out numBytesNeeded, paddingMode);
32
errorCode = Interop.
NCrypt
.NCryptSignHash(keyHandle, pPaddingInfo, hash, signature, out numBytesNeeded, paddingMode);
37
errorCode = Interop.
NCrypt
.NCryptSignHash(keyHandle, pPaddingInfo, hash, signature, out numBytesNeeded, paddingMode);
54
ErrorCode errorCode = Interop.
NCrypt
.NCryptSignHash(keyHandle, pPaddingInfo, hash, destination, out int numBytesNeeded, paddingMode);
58
errorCode = Interop.
NCrypt
.NCryptSignHash(keyHandle, pPaddingInfo, hash, destination, out numBytesNeeded, paddingMode);
73
ErrorCode error = Interop.
NCrypt
.NCryptSignHash(
106
ErrorCode errorCode = Interop.
NCrypt
.NCryptVerifySignature(keyHandle, pPaddingInfo, hash, hash.Length, signature, signature.Length, paddingMode);
110
errorCode = Interop.
NCrypt
.NCryptVerifySignature(keyHandle, pPaddingInfo, hash, hash.Length, signature, signature.Length, paddingMode);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.ImportExport.cs (1)
8
using static Interop.
NCrypt
;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.SignVerify.cs (1)
8
using static Interop.
NCrypt
;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.cs (1)
8
using ErrorCode = Interop.
NCrypt
.ErrorCode;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.NamedCurve.cs (2)
8
using ErrorCode = Interop.
NCrypt
.ErrorCode;
169
errorCode = Interop.
NCrypt
.NCryptImportKey(
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanCng.cs (10)
83
return Interop.
NCrypt
.DeriveKeyMaterialHash(
88
Interop.
NCrypt
.SecretAgreementFlags.None);
104
Interop.
NCrypt
.SecretAgreementFlags flags = hmacKey == null ?
105
Interop.
NCrypt
.SecretAgreementFlags.UseSecretAsHmacKey :
106
Interop.
NCrypt
.SecretAgreementFlags.None;
108
return Interop.
NCrypt
.DeriveKeyMaterialHmac(
126
return Interop.
NCrypt
.DeriveKeyMaterialTls(
130
Interop.
NCrypt
.SecretAgreementFlags.None);
141
return Interop.
NCrypt
.DeriveKeyMaterialTruncate(
143
Interop.
NCrypt
.SecretAgreementFlags.None);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDsaCng.SignVerify.cs (1)
7
using AsymmetricPaddingMode = Interop.
NCrypt
.AsymmetricPaddingMode;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaCng.Windows.cs (5)
251
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
270
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
290
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
325
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
360
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemCng.Windows.cs (5)
12
using ErrorCode = Interop.
NCrypt
.ErrorCode;
111
uint written = Interop.
NCrypt
.NCryptDecapsulate(duplicatedHandle, ciphertext, sharedSecret, 0);
125
Interop.
NCrypt
.NCryptEncapsulate(
247
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(
267
errorCode = Interop.
NCrypt
.NCryptExportKey(
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (4)
7
using AsymmetricPaddingMode = Interop.
NCrypt
.AsymmetricPaddingMode;
9
using ErrorCode = Interop.
NCrypt
.ErrorCode;
290
Interop.
NCrypt
.NCryptEncrypt(key, input, input.Length, paddingInfo, output, output.Length, out bytesNeeded, paddingMode) :
291
Interop.
NCrypt
.NCryptDecrypt(key, input, input.Length, paddingInfo, output, output.Length, out bytesNeeded, paddingMode);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.SignVerify.cs (1)
9
using AsymmetricPaddingMode = Interop.
NCrypt
.AsymmetricPaddingMode;
System\Security\Cryptography\BasicSymmetricCipherLiteNCrypt.cs (5)
11
using AsymmetricPaddingMode = Interop.
NCrypt
.AsymmetricPaddingMode;
12
using ErrorCode = Interop.
NCrypt
.ErrorCode;
103
Interop.
NCrypt
.NCryptEncrypt(keyHandle, input, input.Length, null, output, output.Length, out bytesWritten, AsymmetricPaddingMode.None) :
104
Interop.
NCrypt
.NCryptDecrypt(keyHandle, input, input.Length, null, output, output.Length, out bytesWritten, AsymmetricPaddingMode.None);
126
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(
System\Security\Cryptography\CngAlgorithmCore.cs (1)
6
using static Interop.
NCrypt
;
System\Security\Cryptography\CngHelpers.cs (4)
11
using ErrorCode = Interop.
NCrypt
.ErrorCode;
18
private static readonly CngKeyBlobFormat s_cipherKeyBlobFormat = new CngKeyBlobFormat(Interop.
NCrypt
.NCRYPT_CIPHER_KEY_BLOB);
41
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetProperty(
81
if (ncryptMagic != Interop.
NCrypt
.NCRYPT_CIPHER_KEY_BLOB_MAGIC)
System\Security\Cryptography\CngKey.Create.cs (9)
8
using ErrorCode = Interop.
NCrypt
.ErrorCode;
9
using NCRYPT_UI_POLICY = Interop.
NCrypt
.NCRYPT_UI_POLICY;
45
ErrorCode errorCode = Interop.
NCrypt
.NCryptCreatePersistedKey(providerHandle, out keyHandle, algorithm.Algorithm, keyName, 0, creationParameters.KeyCreationOptions);
54
errorCode = Interop.
NCrypt
.NCryptFinalizeKey(keyHandle, 0);
95
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(keyHandle, KeyPropertyName.KeyUsage, &keyUsage, sizeof(CngKeyUsages), CngPropertyOptions.Persist);
103
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(keyHandle, KeyPropertyName.ParentWindowHandle, &parentWindowHandle, sizeof(IntPtr), CngPropertyOptions.None);
121
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(keyHandle, property.Name, pValue, valueLength, property.Options);
149
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(keyHandle, KeyPropertyName.UIPolicy, &ncryptUiPolicy, sizeof(NCRYPT_UI_POLICY), CngPropertyOptions.Persist);
160
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(keyHandle, KeyPropertyName.UseContext, pinnedUseContext, useContextByteLength, CngPropertyOptions.Persist);
System\Security\Cryptography\CngKey.Delete.cs (2)
6
using ErrorCode = Interop.
NCrypt
.ErrorCode;
20
ErrorCode errorCode = Interop.
NCrypt
.NCryptDeleteKey(_keyHandle, 0);
System\Security\Cryptography\CngKey.Exists.cs (2)
7
using ErrorCode = Interop.
NCrypt
.ErrorCode;
43
ErrorCode errorCode = Interop.
NCrypt
.NCryptOpenKey(providerHandle, out keyHandle, keyName, 0, options);
System\Security\Cryptography\CngKey.Export.cs (3)
6
using ErrorCode = Interop.
NCrypt
.ErrorCode;
23
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(_keyHandle, IntPtr.Zero, format.Format, IntPtr.Zero, null, 0, out numBytesNeeded, 0);
28
errorCode = Interop.
NCrypt
.NCryptExportKey(_keyHandle, IntPtr.Zero, format.Format, IntPtr.Zero, buffer, buffer.Length, out numBytesNeeded, 0);
System\Security\Cryptography\CngKey.Import.cs (10)
8
using ErrorCode = Interop.
NCrypt
.ErrorCode;
59
Interop.
NCrypt
.NCryptBuffer* buffers = stackalloc Interop.
NCrypt
.NCryptBuffer[1];
61
buffers[0] = new Interop.
NCrypt
.NCryptBuffer
63
BufferType = Interop.
NCrypt
.BufferType.PkcsSecret,
73
Interop.
NCrypt
.NCryptBufferDesc desc = new Interop.
NCrypt
.NCryptBufferDesc
80
ErrorCode errorCode = Interop.
NCrypt
.NCryptImportKey(
83
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
131
errorCode = Interop.
NCrypt
.NCryptImportKey(
System\Security\Cryptography\CngKey.Open.cs (2)
7
using ErrorCode = Interop.
NCrypt
.ErrorCode;
40
ErrorCode errorCode = Interop.
NCrypt
.NCryptOpenKey(providerHandle, out keyHandle, keyName, 0, openOptions);
System\Security\Cryptography\CngKey.Properties.cs (3)
6
using ErrorCode = Interop.
NCrypt
.ErrorCode;
41
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetProperty(_keyHandle, name, null, 0, out _, options);
65
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(_keyHandle, property.Name, pinnedPropertyValue, propertyValue.Length, property.Options);
System\Security\Cryptography\CngKey.StandardProperties.cs (9)
8
using ErrorCode = Interop.
NCrypt
.ErrorCode;
9
using NCRYPT_UI_POLICY = Interop.
NCrypt
.NCRYPT_UI_POLICY;
121
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetProperty(_keyHandle, KeyPropertyName.ClrIsEphemeral, &propertyValue, sizeof(byte), out cbResult, CngPropertyOptions.CustomProperty);
145
ErrorCode errorCode = Interop.
NCrypt
.NCryptSetProperty(_keyHandle, KeyPropertyName.ClrIsEphemeral, &isEphemeral, sizeof(byte), CngPropertyOptions.CustomProperty);
205
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetIntProperty(
213
errorCode = Interop.
NCrypt
.NCryptGetIntProperty(
283
Interop.
NCrypt
.NCryptSetProperty(_keyHandle, KeyPropertyName.ParentWindowHandle, &value, IntPtr.Size, CngPropertyOptions.None);
337
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetProperty(_keyHandle, KeyPropertyName.UIPolicy, null, 0, out numBytesNeeded, CngPropertyOptions.None);
362
errorCode = Interop.
NCrypt
.NCryptGetProperty(_keyHandle, KeyPropertyName.UIPolicy, pNcryptUiPolicyAndStrings, ncryptUiPolicyAndStrings.Length, out numBytesNeeded, CngPropertyOptions.None);
System\Security\Cryptography\DSACng.ImportExport.cs (1)
68
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
System\Security\Cryptography\ECDiffieHellmanCng.cs (1)
224
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
System\Security\Cryptography\ECDiffieHellmanCng.Derive.cs (7)
52
Interop.
NCrypt
.SecretAgreementFlags flags =
54
? Interop.
NCrypt
.SecretAgreementFlags.UseSecretAsHmacKey
55
: Interop.
NCrypt
.SecretAgreementFlags.None;
62
return Interop.
NCrypt
.DeriveKeyMaterialHash(
69
return Interop.
NCrypt
.DeriveKeyMaterialHmac(
82
return Interop.
NCrypt
.DeriveKeyMaterialTls(
140
return Interop.
NCrypt
.DeriveSecretAgreement(localHandle, otherPartyHandle);
System\Security\Cryptography\ECDsaCng.cs (1)
169
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
System\Security\Cryptography\RSACng.ImportExport.cs (1)
70
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
System\Security\Cryptography\X25519DiffieHellmanCng.Windows.cs (6)
10
using ErrorCode = Interop.
NCrypt
.ErrorCode;
90
using (SafeNCryptSecretHandle secretAgreement = Interop.
NCrypt
.DeriveSecretAgreement(
94
bool success = Interop.
NCrypt
.TryDeriveKeyMaterialTruncate(
96
Interop.
NCrypt
.SecretAgreementFlags.None,
166
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(
183
errorCode = Interop.
NCrypt
.NCryptExportKey(