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