234 references to NCrypt
System.Security.Cryptography (234)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LibraryImports.g.cs (88)
5140
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)
5146
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5172
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);
5182
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)
5188
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5214
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);
5224
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)
5232
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5267
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);
5277
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)
5285
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5321
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);
5331
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)
5339
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5349
fixed (global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native = &pParameterList)
5376
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);
5386
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)
5392
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5418
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);
5428
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)
5434
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5460
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);
5470
private static unsafe 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)
5476
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5501
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);
5511
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)
5517
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5527
fixed (global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native = &pParameterList)
5544
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);
5554
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptDeleteKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, int dwFlags)
5559
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5581
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, int __dwFlags_native);
5591
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)
5599
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5635
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);
5645
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptFinalizeKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, int dwFlags)
5650
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5672
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hKey_native, int __dwFlags_native);
5682
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)
5688
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5712
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);
5722
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)
5729
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5754
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);
5764
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)
5770
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5780
fixed (global::Interop.
NCrypt
.NCryptBufferDesc* __pParameterList_native = &pParameterList)
5797
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);
5807
private static partial global::Interop.
NCrypt
.ErrorCode NCryptDeriveKey(global::Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle hSharedSecret, string pwszKDF, nint pParameterList, byte* pbDerivedKey, int cbDerivedKey, out int pcbResult, global::Interop.
NCrypt
.SecretAgreementFlags dwFlags)
5813
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5838
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);
5848
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)
5857
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5894
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint __hPrivKey_native, nint __hPubKey_native, nint* __phSecret_native, int __dwFlags_native);
5904
internal static extern partial global::Interop.
NCrypt
.ErrorCode NCryptFreeObject(nint hObject);
5912
internal static partial global::Interop.
NCrypt
.ErrorCode NCryptOpenStorageProvider(out global::Microsoft.Win32.SafeHandles.SafeNCryptProviderHandle phProvider, string pszProviderName, int dwFlags)
5919
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5947
static extern unsafe global::Interop.
NCrypt
.ErrorCode __PInvoke(nint* __phProvider_native, ushort* __pszProviderName_native, int __dwFlags_native);
5957
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)
5963
global::Interop.
NCrypt
.ErrorCode __retVal = default;
5988
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);
5998
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)
6003
global::Interop.
NCrypt
.ErrorCode __retVal = default;
6027
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);
6037
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)
6043
global::Interop.
NCrypt
.ErrorCode __retVal = default;
6067
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);
6077
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)
6082
global::Interop.
NCrypt
.ErrorCode __retVal = default;
6104
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)
11
using ErrorCode = Interop.
NCrypt
.ErrorCode;
350
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(
58
ErrorCode errorCode = Interop.
NCrypt
.NCryptGetProperty(
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (26)
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;
253
buffers[0] = new Interop.
NCrypt
.NCryptBuffer
255
BufferType = Interop.
NCrypt
.BufferType.PkcsSecret,
265
buffers[1] = new Interop.
NCrypt
.NCryptBuffer
267
BufferType = Interop.
NCrypt
.BufferType.PkcsAlgOid,
272
buffers[2] = new Interop.
NCrypt
.NCryptBuffer
274
BufferType = Interop.
NCrypt
.BufferType.PkcsAlgParam,
275
cbBuffer = sizeof(Interop.
NCrypt
.PBE_PARAMS),
279
Interop.
NCrypt
.NCryptBufferDesc desc = new Interop.
NCrypt
.NCryptBufferDesc
288
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(
291
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
316
errorCode = Interop.
NCrypt
.NCryptExportKey(
319
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\CompositeMLDsaCng.Windows.cs (2)
88
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
120
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLKemCng.Windows.cs (2)
75
uint written = Interop.
NCrypt
.NCryptDecapsulate(duplicatedHandle, ciphertext, sharedSecret, 0);
94
Interop.
NCrypt
.NCryptEncapsulate(
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)
241
Interop.
NCrypt
.NCRYPT_PKCS8_PRIVATE_KEY_BLOB,
260
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
280
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
315
Interop.
NCrypt
.AsymmetricPaddingMode.NCRYPT_PAD_PQDSA_FLAG,
350
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;
101
uint written = Interop.
NCrypt
.NCryptDecapsulate(duplicatedHandle, ciphertext, sharedSecret, 0);
115
Interop.
NCrypt
.NCryptEncapsulate(
237
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(
257
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;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellmanCng.Windows.cs (6)
10
using ErrorCode = Interop.
NCrypt
.ErrorCode;
102
using (SafeNCryptSecretHandle secretAgreement = Interop.
NCrypt
.DeriveSecretAgreement(
112
bool success = Interop.
NCrypt
.TryDeriveKeyMaterialTruncate(
114
Interop.
NCrypt
.SecretAgreementFlags.None,
190
ErrorCode errorCode = Interop.
NCrypt
.NCryptExportKey(
207
errorCode = Interop.
NCrypt
.NCryptExportKey(
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,