_generated\0\LibraryImports.g.cs (42)
3894internal static unsafe partial bool CertSetCertificateContextProperty(global::Microsoft.Win32.SafeHandles.SafeCertContextHandle pCertContext, global::Interop.Crypt32.CertContextPropId dwPropId, global::Interop.Crypt32.CertSetPropertyFlags dwFlags, global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle keyHandle)
3902global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __keyHandle_native__marshaller = new();
3942internal static unsafe partial bool CertSetCertificateContextProperty(nint pCertContext, global::Interop.Crypt32.CertContextPropId dwPropId, global::Interop.Crypt32.CertSetPropertyFlags dwFlags, global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle keyHandle)
3949global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __keyHandle_native__marshaller = new();
4042public static partial bool CryptAcquireCertificatePrivateKey(global::Microsoft.Win32.SafeHandles.SafeCertContextHandle pCert, global::Interop.Crypt32.CryptAcquireCertificatePrivateKeyFlags dwFlags, nint pvParameters, out global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle phCryptProvOrNCryptKey, out global::Interop.Crypt32.CryptKeySpec pdwKeySpec, out bool pfCallerFreeProvOrNCryptKey)
4055global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedOut __phCryptProvOrNCryptKey_native__marshaller = new();
4998internal 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)
5004global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5038internal 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)
5044global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5078internal 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)
5086global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedOut __phKey_native__marshaller = new();
5131internal 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)
5139global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedOut __phKey_native__marshaller = new();
5185internal 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)
5193global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedOut __phKey_native__marshaller = new();
5240internal 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)
5246global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5280internal 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)
5286global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5320private 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)
5326global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5359internal 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)
5365global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5400internal static partial global::Interop.NCrypt.ErrorCode NCryptDeleteKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, int dwFlags)
5405global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5435internal 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)
5443global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedOut __phKey_native__marshaller = new();
5489internal static partial global::Interop.NCrypt.ErrorCode NCryptFinalizeKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, int dwFlags)
5494global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5524private 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)
5530global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5562private 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)
5569global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5682private 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)
5692global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hPubKey_native__marshaller = new();
5693global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hPrivKey_native__marshaller = new();
5866private 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)
5872global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
5904private 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)
5909global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle>.ManagedToUnmanagedIn __hKey_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.EncryptDecrypt.cs (2)
14internal static unsafe partial ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags);
18internal static unsafe partial ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.Keys.cs (11)
21internal static partial ErrorCode NCryptOpenKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszKeyName, int dwLegacyKeySpec, CngKeyOpenOptions dwFlags);
25internal static partial ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, IntPtr pParameterList, out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags);
29internal static partial ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags);
33internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, byte[]? pbOutput, int cbOutput, out int pcbResult, int dwFlags);
37internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags);
41private static unsafe partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, byte* pbOutput, int cbOutput, out int pcbResult, int dwFlags);
43internal static unsafe ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, Span<byte> pbOutput, int cbOutput, out int pcbResult, int dwFlags)
53internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags);
57internal static partial ErrorCode NCryptDeleteKey(SafeNCryptKeyHandle hKey, int dwFlags);
61internal static partial ErrorCode NCryptCreatePersistedKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszAlgId, string? pszKeyName, int dwLegacyKeySpec, CngKeyCreationOptions dwFlags);
65internal static partial ErrorCode NCryptFinalizeKey(SafeNCryptKeyHandle hKey, int dwFlags);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.SignVerify.cs (4)
15private static unsafe partial ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, byte* pbHashValue, int cbHashValue, byte* pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags);
17internal static unsafe ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, Span<byte> pbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags)
28private static unsafe partial ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, byte* pbHashValue, int cbHashValue, byte* pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags);
30internal static unsafe ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, int cbHashValue, ReadOnlySpan<byte> pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.SignVerify.cs (4)
15public static unsafe byte[] SignHash(this SafeNCryptKeyHandle keyHandle, ReadOnlySpan<byte> hash, AsymmetricPaddingMode paddingMode, void* pPaddingInfo, int estimatedSize)
48this SafeNCryptKeyHandle keyHandle,
69public static unsafe bool TrySignHash(this SafeNCryptKeyHandle keyHandle, ReadOnlySpan<byte> hash, Span<byte> signature, AsymmetricPaddingMode paddingMode, void* pPaddingInfo, out int bytesWritten)
104public static unsafe bool VerifyHash(this SafeNCryptKeyHandle keyHandle, ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, AsymmetricPaddingMode paddingMode, void* pPaddingInfo)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (5)
56using (SafeNCryptKeyHandle keyHandle = GetDuplicatedKeyHandle())
138using (SafeNCryptKeyHandle keyHandle = GetDuplicatedKeyHandle())
198private unsafe byte[] EncryptOrDecrypt(SafeNCryptKeyHandle key, ReadOnlySpan<byte> input, AsymmetricPaddingMode paddingMode, void* paddingInfo, bool encrypt)
254private static unsafe bool TryEncryptOrDecrypt(SafeNCryptKeyHandle key, ReadOnlySpan<byte> input, Span<byte> output, AsymmetricPaddingMode paddingMode, void* paddingInfo, bool encrypt, out int bytesWritten)
281SafeNCryptKeyHandle key,