File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\runtime\src\libraries\System.Net.Quic\src\System.Net.Quic.csproj (System.Net.Quic)
// <auto-generated/>
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeAsn1ObjectHandle ObjTxt2Obj(string s)
        {
            bool __invokeSucceeded = default;
            byte* __s_native = default;
            global::Microsoft.Win32.SafeHandles.SafeAsn1ObjectHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeAsn1ObjectHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __s_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __s_native__marshaller.FromManaged(s, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __s_native = __s_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__s_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __s_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ObjTxt2Obj", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(byte* __s_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ObjObj2Txt", ExactSpelling = true)]
        private static unsafe extern partial int ObjObj2Txt(byte* buf, int buf_len, nint a);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial nint CryptoNative_GetObjectDefinitionByName(string friendlyName)
        {
            byte* __friendlyName_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __friendlyName_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __friendlyName_native__marshaller.FromManaged(friendlyName, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __friendlyName_native = __friendlyName_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__friendlyName_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __friendlyName_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetObjectDefinitionByName", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(byte* __friendlyName_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ObjNid2Obj", ExactSpelling = true)]
        internal static extern partial nint ObjNid2Obj(int nid);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_Asn1ObjectFree", ExactSpelling = true)]
        internal static extern partial void Asn1ObjectFree(nint o);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeAsn1OctetStringHandle Asn1OctetStringNew()
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeAsn1OctetStringHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeAsn1OctetStringHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke();
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_Asn1OctetStringNew", ExactSpelling = true)]
            static extern unsafe nint __PInvoke();
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool Asn1OctetStringSet(global::Microsoft.Win32.SafeHandles.SafeAsn1OctetStringHandle o, byte[] d, int len)
        {
            nint __o_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeAsn1OctetStringHandle>.ManagedToUnmanagedIn __o_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __o_native__marshaller.FromManaged(o);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __d_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(d))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __o_native = __o_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__o_native, (byte*)__d_native, len);
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __o_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_Asn1OctetStringSet", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __o_native, byte* __d_native, int __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_Asn1OctetStringFree", ExactSpelling = true)]
        internal static extern partial void Asn1OctetStringFree(nint o);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeBioHandle CreateMemoryBio()
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeBioHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke();
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_CreateMemoryBio", ExactSpelling = true)]
            static extern unsafe nint __PInvoke();
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeBioHandle BioNewFile(string filename, string mode)
        {
            bool __invokeSucceeded = default;
            byte* __filename_native = default;
            byte* __mode_native = default;
            global::Microsoft.Win32.SafeHandles.SafeBioHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __mode_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __filename_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __mode_native__marshaller.FromManaged(mode, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __filename_native__marshaller.FromManaged(filename, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __mode_native = __mode_native__marshaller.ToUnmanaged();
                    __filename_native = __filename_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__filename_native, __mode_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __mode_native__marshaller.Free();
                __filename_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioNewFile", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(byte* __filename_native, byte* __mode_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool BioDestroy(nint a)
        {
            bool __retVal;
            int __retVal_native;
            {
                __retVal_native = __PInvoke(a);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioDestroy", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __a_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static unsafe partial int BioGets(global::Microsoft.Win32.SafeHandles.SafeBioHandle b, byte* buf, int size)
        {
            nint __b_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __b_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __b_native__marshaller.FromManaged(b);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __b_native = __b_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__b_native, buf, size);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __b_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioGets", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __b_native, byte* __buf_native, int __size_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int BioRead(global::Microsoft.Win32.SafeHandles.SafeBioHandle b, byte[] data, int len)
        {
            nint __b_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __b_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __b_native__marshaller.FromManaged(b);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __data_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(data))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __b_native = __b_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__b_native, (byte*)__data_native, len);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __b_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioRead", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __b_native, byte* __data_native, int __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int BioRead(global::Microsoft.Win32.SafeHandles.SafeBioHandle b, global::System.Span<byte> data, int len)
        {
            nint __b_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __b_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __b_native__marshaller.FromManaged(b);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __data_native = &global::System.Runtime.InteropServices.Marshalling.SpanMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(data))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __b_native = __b_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__b_native, (byte*)__data_native, len);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __b_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioRead", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __b_native, byte* __data_native, int __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int BioWrite(global::Microsoft.Win32.SafeHandles.SafeBioHandle b, byte[] data, int len)
        {
            nint __b_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __b_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __b_native__marshaller.FromManaged(b);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __data_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(data))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __b_native = __b_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__b_native, (byte*)__data_native, len);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __b_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioWrite", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __b_native, byte* __data_native, int __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int BioWrite(global::Microsoft.Win32.SafeHandles.SafeBioHandle b, ref byte data, int len)
        {
            nint __b_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __b_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __b_native__marshaller.FromManaged(b);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (byte* __data_native = &data)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __b_native = __b_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__b_native, __data_native, len);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __b_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioWrite", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __b_native, byte* __data_native, int __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int GetMemoryBioSize(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio)
        {
            nint __bio_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__bio_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetMemoryBioSize", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __bio_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int BioCtrlPending(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio)
        {
            nint __bio_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__bio_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioCtrlPending", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __bio_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ErrClearError", ExactSpelling = true)]
        internal static extern partial ulong ErrClearError();
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial ulong ErrGetExceptionError(out bool isAllocFailure)
        {
            isAllocFailure = default;
            int __isAllocFailure_native;
            ulong __retVal;
            {
                __retVal = __PInvoke(&__isAllocFailure_native);
            }
 
            // Unmarshal - Convert native data to managed data.
            isAllocFailure = __isAllocFailure_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ErrGetExceptionError", ExactSpelling = true)]
            static extern unsafe ulong __PInvoke(int* __isAllocFailure_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ErrPeekError", ExactSpelling = true)]
        internal static extern partial ulong ErrPeekError();
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ErrPeekLastError", ExactSpelling = true)]
        internal static extern partial ulong ErrPeekLastError();
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ErrReasonErrorString", ExactSpelling = true)]
        internal static unsafe extern partial byte* ErrReasonErrorString(ulong error);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ErrErrorStringN", ExactSpelling = true)]
        private static unsafe extern partial void ErrErrorStringN(ulong e, byte* buf, int len);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class CryptoInitializer
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_EnsureOpenSslInitialized", ExactSpelling = true)]
        private static extern partial int EnsureOpenSslInitialized();
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int CryptoNative_BioTell(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio)
        {
            nint __bio_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__bio_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioTell", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __bio_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int BioSeek(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio, int pos)
        {
            nint __bio_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__bio_native, pos);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_BioSeek", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __bio_native, int __pos_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int GetX509Thumbprint(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509, byte[] buf, int cBuf)
        {
            nint __x509_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __buf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(buf))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native, (byte*)__buf_native, cBuf);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509Thumbprint", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509_native, byte* __buf_native, int __cBuf_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int GetX509NameRawBytes(nint x509Name, byte[] buf, int cBuf)
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __buf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(buf))
            {
                __retVal = __PInvoke(x509Name, (byte*)__buf_native, cBuf);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509NameRawBytes", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509Name_native, byte* __buf_native, int __cBuf_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle ReadX509AsDerFromBio(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio)
        {
            bool __invokeSucceeded = default;
            nint __bio_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__bio_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ReadX509AsDerFromBio", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __bio_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint GetX509CrlNextUpdate(global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle crl)
        {
            nint __crl_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle>.ManagedToUnmanagedIn __crl_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __crl_native__marshaller.FromManaged(crl);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __crl_native = __crl_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__crl_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __crl_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509CrlNextUpdate", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __crl_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int GetX509Version(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __x509_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509Version", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int GetX509PublicKeyParameterBytes(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509, byte[] buf, int cBuf)
        {
            nint __x509_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __buf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(buf))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native, (byte*)__buf_native, cBuf);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509PublicKeyParameterBytes", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509_native, byte* __buf_native, int __cBuf_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeBioHandle GetX509NameInfo(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509, int nameType, bool forIssuer)
        {
            bool __invokeSucceeded = default;
            nint __x509_native = default;
            int __forIssuer_native = default;
            global::Microsoft.Win32.SafeHandles.SafeBioHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __forIssuer_native = (int)(forIssuer ? 1 : 0);
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__x509_native, nameType, __forIssuer_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509NameInfo", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x509_native, int __nameType_native, int __forIssuer_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int GetAsn1StringBytes(nint asn1, byte[] buf, int cBuf)
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __buf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(buf))
            {
                __retVal = __PInvoke(asn1, (byte*)__buf_native, cBuf);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetAsn1StringBytes", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __asn1_native, byte* __buf_native, int __cBuf_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool PushX509StackField(global::Microsoft.Win32.SafeHandles.SafeX509StackHandle stack, global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __stack_native = default;
            nint __x509_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __stack_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                __stack_native__marshaller.FromManaged(stack);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __stack_native = __stack_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__stack_native, __x509_native);
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
                __stack_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_PushX509StackField", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __stack_native, nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool PushX509StackField(global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle stack, global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __stack_native = default;
            nint __x509_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle>.ManagedToUnmanagedIn __stack_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                __stack_native__marshaller.FromManaged(stack);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __stack_native = __stack_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__stack_native, __x509_native);
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
                __stack_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_PushX509StackField", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __stack_native, nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509RootStorePath", ExactSpelling = true)]
        private static unsafe extern partial byte* GetX509RootStorePath_private(byte* defaultPath);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509RootStoreFile", ExactSpelling = true)]
        private static unsafe extern partial byte* GetX509RootStoreFile_private(byte* defaultPath);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_X509StoreSetVerifyTime(global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle ctx, int year, int month, int day, int hour, int minute, int second, bool isDst)
        {
            nint __ctx_native = default;
            int __isDst_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __isDst_native = (int)(isDst ? 1 : 0);
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native, year, month, day, hour, minute, second, __isDst_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreSetVerifyTime", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native, int __year_native, int __month_native, int __day_native, int __hour_native, int __minute_native, int __second_native, int __isDst_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int CheckX509IpAddress(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509, byte[] addressBytes, int addressLen, string hostname, int cchHostname)
        {
            nint __x509_native = default;
            byte* __hostname_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __hostname_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __hostname_native__marshaller.FromManaged(hostname, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __x509_native__marshaller.FromManaged(x509);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __addressBytes_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(addressBytes))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __hostname_native = __hostname_native__marshaller.ToUnmanaged();
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native, (byte*)__addressBytes_native, addressLen, __hostname_native, cchHostname);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __hostname_native__marshaller.Free();
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_CheckX509IpAddress", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509_native, byte* __addressBytes_native, int __addressLen_native, byte* __hostname_native, int __cchHostname_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int CheckX509Hostname(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509, string hostname, int cchHostname)
        {
            nint __x509_native = default;
            byte* __hostname_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __hostname_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __hostname_native__marshaller.FromManaged(hostname, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __hostname_native = __hostname_native__marshaller.ToUnmanaged();
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native, __hostname_native, cchHostname);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __hostname_native__marshaller.Free();
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_CheckX509Hostname", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509_native, byte* __hostname_native, int __cchHostname_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_IsSignatureAlgorithmAvailable(string algorithm)
        {
            byte* __algorithm_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __algorithm_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __algorithm_native__marshaller.FromManaged(algorithm, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __algorithm_native = __algorithm_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__algorithm_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __algorithm_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_IsSignatureAlgorithmAvailable", ExactSpelling = true)]
            static extern unsafe int __PInvoke(byte* __algorithm_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial void GetMemoryUse(ref long memoryUse, ref long allocationCount)
        {
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (long* __allocationCount_native = &allocationCount)
            fixed (long* __memoryUse_native = &memoryUse)
            {
                __PInvoke(__memoryUse_native, __allocationCount_native);
            }
 
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetMemoryUse", ExactSpelling = true)]
            static extern unsafe void __PInvoke(long* __memoryUse_native, long* __allocationCount_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_EnableMemoryTracking", ExactSpelling = true)]
        internal static unsafe extern partial void EnableMemoryTracking(int enable);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_ForEachTrackedAllocation", ExactSpelling = true)]
        private static unsafe extern partial void ForEachTrackedAllocation(delegate* unmanaged<nint, ulong, char*, int, nint, void> callback, nint ctx);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint GetX509NotBefore(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __x509_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509NotBefore", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint GetX509NotAfter(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __x509_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509NotAfter", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint GetX509SignatureAlgorithm(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __x509_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509SignatureAlgorithm", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint GetX509PublicKeyAlgorithm(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __x509_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509PublicKeyAlgorithm", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint GetX509PublicKeyBytes(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __x509_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509PublicKeyBytes", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::System.Security.Cryptography.SafeEvpPKeyHandle GetX509EvpPublicKey(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            bool __invokeSucceeded = default;
            nint __x509_native = default;
            global::System.Security.Cryptography.SafeEvpPKeyHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Security.Cryptography.SafeEvpPKeyHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__x509_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509EvpPublicKey", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle DecodeX509Crl(byte[] buf, int len)
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __buf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(buf))
                {
                    __retVal_native = __PInvoke((byte*)__buf_native, len);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_DecodeX509Crl", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(byte* __buf_native, int __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle DecodeX509(ref byte buf, int len)
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (byte* __buf_native = &buf)
                {
                    __retVal_native = __PInvoke(__buf_native, len);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_DecodeX509", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(byte* __buf_native, int __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle DecodeX509(nint buf, int len)
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke(buf, len);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_DecodeX509", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __buf_native, int __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int GetX509DerSize(global::Microsoft.Win32.SafeHandles.SafeX509Handle x)
        {
            nint __x_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509DerSize", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int EncodeX509(global::Microsoft.Win32.SafeHandles.SafeX509Handle x, byte[] buf)
        {
            nint __x_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __buf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(buf))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x_native, (byte*)__buf_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_EncodeX509", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x_native, byte* __buf_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509Destroy", ExactSpelling = true)]
        internal static extern partial void X509Destroy(nint a);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle X509Duplicate(nint handle)
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke(handle);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509Duplicate", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __handle_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle X509Duplicate(global::Microsoft.Win32.SafeHandles.SafeX509Handle handle)
        {
            bool __invokeSucceeded = default;
            nint __handle_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __handle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __handle_native__marshaller.FromManaged(handle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __handle_native = __handle_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__handle_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __handle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509Duplicate", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __handle_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle X509UpRef(nint handle)
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke(handle);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509UpRef", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __handle_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle X509UpRef(global::Microsoft.Win32.SafeHandles.SafeX509Handle handle)
        {
            bool __invokeSucceeded = default;
            nint __handle_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __handle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __handle_native__marshaller.FromManaged(handle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __handle_native = __handle_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__handle_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __handle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509UpRef", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __handle_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle PemReadX509FromBio(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio)
        {
            bool __invokeSucceeded = default;
            nint __bio_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__bio_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_PemReadX509FromBio", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __bio_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle PemReadX509FromBioAux(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio)
        {
            bool __invokeSucceeded = default;
            nint __bio_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__bio_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_PemReadX509FromBioAux", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __bio_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial global::Microsoft.Win32.SafeHandles.SafeSharedAsn1IntegerHandle CryptoNative_X509GetSerialNumber(global::Microsoft.Win32.SafeHandles.SafeX509Handle x)
        {
            bool __invokeSucceeded = default;
            nint __x_native = default;
            global::Microsoft.Win32.SafeHandles.SafeSharedAsn1IntegerHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedAsn1IntegerHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__x_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509GetSerialNumber", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint X509GetIssuerName(global::Microsoft.Win32.SafeHandles.SafeX509Handle x)
        {
            nint __x_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509GetIssuerName", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint X509GetSubjectName(global::Microsoft.Win32.SafeHandles.SafeX509Handle x)
        {
            nint __x_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509GetSubjectName", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool X509CheckPurpose(global::Microsoft.Win32.SafeHandles.SafeX509Handle x, int id, int ca)
        {
            nint __x_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__x_native, id, ca);
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509CheckPurpose", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x_native, int __id_native, int __ca_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial ulong X509IssuerNameHash(global::Microsoft.Win32.SafeHandles.SafeX509Handle x)
        {
            nint __x_native = default;
            ulong __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509IssuerNameHash", ExactSpelling = true)]
            static extern unsafe ulong __PInvoke(nint __x_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial global::Microsoft.Win32.SafeHandles.SafeSharedAsn1OctetStringHandle CryptoNative_X509FindExtensionData(global::Microsoft.Win32.SafeHandles.SafeX509Handle x, int extensionNid)
        {
            bool __invokeSucceeded = default;
            nint __x_native = default;
            global::Microsoft.Win32.SafeHandles.SafeSharedAsn1OctetStringHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedAsn1OctetStringHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__x_native, extensionNid);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509FindExtensionData", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x_native, int __extensionNid_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int X509GetExtCount(global::Microsoft.Win32.SafeHandles.SafeX509Handle x)
        {
            nint __x_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509GetExtCount", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint X509GetExt(global::Microsoft.Win32.SafeHandles.SafeX509Handle x, int loc)
        {
            nint __x_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x_native, loc);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509GetExt", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __x_native, int __loc_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509ExtensionGetOid", ExactSpelling = true)]
        internal static extern partial nint X509ExtensionGetOid(nint ex);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509ExtensionGetData", ExactSpelling = true)]
        internal static extern partial nint X509ExtensionGetData(nint ex);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool X509ExtensionGetCritical(nint ex)
        {
            bool __retVal;
            int __retVal_native;
            {
                __retVal_native = __PInvoke(ex);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509ExtensionGetCritical", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ex_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle CryptoNative_X509ChainNew(global::Microsoft.Win32.SafeHandles.SafeX509StackHandle systemTrust, global::Microsoft.Win32.SafeHandles.SafeX509StackHandle userTrust)
        {
            bool __invokeSucceeded = default;
            nint __systemTrust_native = default;
            nint __userTrust_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __userTrust_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __systemTrust_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __userTrust_native__marshaller.FromManaged(userTrust);
                __systemTrust_native__marshaller.FromManaged(systemTrust);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __userTrust_native = __userTrust_native__marshaller.ToUnmanaged();
                    __systemTrust_native = __systemTrust_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__systemTrust_native, __userTrust_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __userTrust_native__marshaller.Free();
                __systemTrust_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509ChainNew", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __systemTrust_native, nint __userTrust_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreDestroy", ExactSpelling = true)]
        internal static extern partial void X509StoreDestroy(nint v);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool X509StoreAddCrl(global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle ctx, global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle x)
        {
            nint __ctx_native = default;
            nint __x_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle>.ManagedToUnmanagedIn __x_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x_native__marshaller.FromManaged(x);
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x_native = __x_native__marshaller.ToUnmanaged();
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__ctx_native, __x_native);
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x_native__marshaller.Free();
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreAddCrl", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native, nint __x_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial bool CryptoNative_X509StoreSetRevocationFlag(global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle ctx, global::System.Security.Cryptography.X509Certificates.X509RevocationFlag revocationFlag)
        {
            nint __ctx_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__ctx_native, revocationFlag);
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreSetRevocationFlag", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native, global::System.Security.Cryptography.X509Certificates.X509RevocationFlag __revocationFlag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool X509StoreCtxInit(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx, global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle store, global::Microsoft.Win32.SafeHandles.SafeX509Handle x509, global::Microsoft.Win32.SafeHandles.SafeX509StackHandle extraCerts)
        {
            nint __ctx_native = default;
            nint __store_native = default;
            nint __x509_native = default;
            nint __extraCerts_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __extraCerts_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle>.ManagedToUnmanagedIn __store_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __extraCerts_native__marshaller.FromManaged(extraCerts);
                __x509_native__marshaller.FromManaged(x509);
                __store_native__marshaller.FromManaged(store);
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __extraCerts_native = __extraCerts_native__marshaller.ToUnmanaged();
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __store_native = __store_native__marshaller.ToUnmanaged();
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__ctx_native, __store_native, __x509_native, __extraCerts_native);
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __extraCerts_native__marshaller.Free();
                __x509_native__marshaller.Free();
                __store_native__marshaller.Free();
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxInit", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native, nint __store_native, nint __x509_native, nint __extraCerts_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_X509VerifyCert(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            nint __ctx_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509VerifyCert", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int CryptoNative_X509StoreCtxGetError(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            nint __ctx_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxGetError", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_X509StoreCtxReset(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            nint __ctx_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxReset", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_X509StoreCtxRebuildChain(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            nint __ctx_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxRebuildChain", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int X509StoreCtxGetErrorDepth(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            nint __ctx_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxGetErrorDepth", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static unsafe partial int CryptoNative_X509StoreCtxSetVerifyCallback(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx, delegate* unmanaged<int, nint, int> callback, void* appData)
        {
            nint __ctx_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native, callback, appData);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxSetVerifyCallback", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native, delegate* unmanaged<int, nint, int> __callback_native, void* __appData_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static unsafe partial void* X509StoreCtxGetAppData(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            nint __ctx_native = default;
            void* __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxGetAppData", ExactSpelling = true)]
            static extern unsafe void* __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509VerifyCertErrorString", ExactSpelling = true)]
        private static unsafe extern partial byte* CryptoNative_X509VerifyCertErrorString(int n);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509CrlDestroy", ExactSpelling = true)]
        internal static extern partial void X509CrlDestroy(nint a);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int PemWriteBioX509Crl(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio, global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle crl)
        {
            nint __bio_native = default;
            nint __crl_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle>.ManagedToUnmanagedIn __crl_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __crl_native__marshaller.FromManaged(crl);
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __crl_native = __crl_native__marshaller.ToUnmanaged();
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__bio_native, __crl_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __crl_native__marshaller.Free();
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_PemWriteBioX509Crl", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __bio_native, nint __crl_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle PemReadBioX509Crl(global::Microsoft.Win32.SafeHandles.SafeBioHandle bio)
        {
            bool __invokeSucceeded = default;
            nint __bio_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509CrlHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __bio_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __bio_native__marshaller.FromManaged(bio);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __bio_native = __bio_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__bio_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __bio_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_PemReadBioX509Crl", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __bio_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int GetX509SubjectPublicKeyInfoDerSize(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509)
        {
            nint __x509_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509SubjectPublicKeyInfoDerSize", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int EncodeX509SubjectPublicKeyInfo(global::Microsoft.Win32.SafeHandles.SafeX509Handle x509, byte[] buf)
        {
            nint __x509_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedIn __x509_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509_native__marshaller.FromManaged(x509);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __buf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(buf))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509_native = __x509_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509_native, (byte*)__buf_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_EncodeX509SubjectPublicKeyInfo", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509_native, byte* __buf_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int GetX509NameStackFieldCount(global::Microsoft.Win32.SafeHandles.SafeSharedX509NameStackHandle sk)
        {
            nint __sk_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedX509NameStackHandle>.ManagedToUnmanagedIn __sk_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __sk_native__marshaller.FromManaged(sk);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __sk_native = __sk_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__sk_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __sk_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509NameStackFieldCount", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __sk_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial global::Microsoft.Win32.SafeHandles.SafeSharedX509NameHandle GetX509NameStackField_private(global::Microsoft.Win32.SafeHandles.SafeSharedX509NameStackHandle sk, int loc)
        {
            bool __invokeSucceeded = default;
            nint __sk_native = default;
            global::Microsoft.Win32.SafeHandles.SafeSharedX509NameHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedX509NameHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedX509NameStackHandle>.ManagedToUnmanagedIn __sk_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __sk_native__marshaller.FromManaged(sk);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __sk_native = __sk_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__sk_native, loc);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __sk_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509NameStackField", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __sk_native, int __loc_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int GetX509NameRawBytes(global::Microsoft.Win32.SafeHandles.SafeSharedX509NameHandle x509Name, byte[] buf, int cBuf)
        {
            nint __x509Name_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedX509NameHandle>.ManagedToUnmanagedIn __x509Name_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __x509Name_native__marshaller.FromManaged(x509Name);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __buf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(buf))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __x509Name_native = __x509Name_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__x509Name_native, (byte*)__buf_native, cBuf);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __x509Name_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509NameRawBytes", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __x509Name_native, byte* __buf_native, int __cBuf_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509ExtensionHandle X509ExtensionCreateByObj(global::Microsoft.Win32.SafeHandles.SafeAsn1ObjectHandle oid, bool isCritical, global::Microsoft.Win32.SafeHandles.SafeAsn1OctetStringHandle data)
        {
            bool __invokeSucceeded = default;
            nint __oid_native = default;
            int __isCritical_native = default;
            nint __data_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509ExtensionHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509ExtensionHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeAsn1OctetStringHandle>.ManagedToUnmanagedIn __data_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeAsn1ObjectHandle>.ManagedToUnmanagedIn __oid_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __data_native__marshaller.FromManaged(data);
                __isCritical_native = (int)(isCritical ? 1 : 0);
                __oid_native__marshaller.FromManaged(oid);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __data_native = __data_native__marshaller.ToUnmanaged();
                    __oid_native = __oid_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__oid_native, __isCritical_native, __data_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __data_native__marshaller.Free();
                __oid_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509ExtensionCreateByObj", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __oid_native, int __isCritical_native, nint __data_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509ExtensionDestroy", ExactSpelling = true)]
        internal static extern partial int X509ExtensionDestroy(nint x);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial bool X509V3ExtPrint(global::Microsoft.Win32.SafeHandles.SafeBioHandle buf, global::Microsoft.Win32.SafeHandles.SafeX509ExtensionHandle ext)
        {
            nint __buf_native = default;
            nint __ext_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509ExtensionHandle>.ManagedToUnmanagedIn __ext_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBioHandle>.ManagedToUnmanagedIn __buf_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ext_native__marshaller.FromManaged(ext);
                __buf_native__marshaller.FromManaged(buf);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ext_native = __ext_native__marshaller.ToUnmanaged();
                    __buf_native = __buf_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__buf_native, __ext_native);
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ext_native__marshaller.Free();
                __buf_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509V3ExtPrint", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __buf_native, nint __ext_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509StackHandle NewX509Stack()
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeX509StackHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke();
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_NewX509Stack", ExactSpelling = true)]
            static extern unsafe nint __PInvoke();
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_RecursiveFreeX509Stack", ExactSpelling = true)]
        internal static extern partial void RecursiveFreeX509Stack(nint stack);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int GetX509StackFieldCount(global::Microsoft.Win32.SafeHandles.SafeX509StackHandle stack)
        {
            nint __stack_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __stack_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __stack_native__marshaller.FromManaged(stack);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __stack_native = __stack_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__stack_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __stack_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509StackFieldCount", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __stack_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial int GetX509StackFieldCount(global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle stack)
        {
            nint __stack_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle>.ManagedToUnmanagedIn __stack_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __stack_native__marshaller.FromManaged(stack);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __stack_native = __stack_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__stack_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __stack_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509StackFieldCount", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __stack_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint GetX509StackField(global::Microsoft.Win32.SafeHandles.SafeX509StackHandle stack, int loc)
        {
            nint __stack_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __stack_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __stack_native__marshaller.FromManaged(stack);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __stack_native = __stack_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__stack_native, loc);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __stack_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509StackField", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __stack_native, int __loc_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial nint GetX509StackField(global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle stack, int loc)
        {
            nint __stack_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle>.ManagedToUnmanagedIn __stack_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __stack_native__marshaller.FromManaged(stack);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __stack_native = __stack_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__stack_native, loc);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __stack_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_GetX509StackField", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __stack_native, int __loc_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_X509StackAddDirectoryStore(global::Microsoft.Win32.SafeHandles.SafeX509StackHandle stack, string storePath)
        {
            nint __stack_native = default;
            byte* __storePath_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __storePath_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __stack_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __storePath_native__marshaller.FromManaged(storePath, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __stack_native__marshaller.FromManaged(stack);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __storePath_native = __storePath_native__marshaller.ToUnmanaged();
                    __stack_native = __stack_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__stack_native, __storePath_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __storePath_native__marshaller.Free();
                __stack_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StackAddDirectoryStore", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __stack_native, byte* __storePath_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_X509StackAddMultiple(global::Microsoft.Win32.SafeHandles.SafeX509StackHandle dest, global::Microsoft.Win32.SafeHandles.SafeX509StackHandle src)
        {
            nint __dest_native = default;
            nint __src_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __src_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedIn __dest_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __src_native__marshaller.FromManaged(src);
                __dest_native__marshaller.FromManaged(dest);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __src_native = __src_native__marshaller.ToUnmanaged();
                    __dest_native = __dest_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__dest_native, __src_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __src_native__marshaller.Free();
                __dest_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StackAddMultiple", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __dest_native, nint __src_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle X509StoreCtxCreate()
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke();
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxCreate", ExactSpelling = true)]
            static extern unsafe nint __PInvoke();
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxDestroy", ExactSpelling = true)]
        internal static extern partial void X509StoreCtxDestroy(nint v);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509StackHandle X509StoreCtxGetChain(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            bool __invokeSucceeded = default;
            nint __ctx_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509StackHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StackHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__ctx_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxGetChain", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeX509Handle X509StoreCtxGetCurrentCert(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            bool __invokeSucceeded = default;
            nint __ctx_native = default;
            global::Microsoft.Win32.SafeHandles.SafeX509Handle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509Handle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__ctx_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxGetCurrentCert", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_X509StoreCtxCommitToChain(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            nint __ctx_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxCommitToChain", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial int CryptoNative_X509StoreCtxResetForSignatureError(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx, out global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle newStore)
        {
            bool __invokeSucceeded = default;
            newStore = default;
            nint __ctx_native = default;
            nint __newStore_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreHandle>.ManagedToUnmanagedOut __newStore_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ctx_native, &__newStore_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __newStore_native__marshaller.FromUnmanaged(__newStore_native);
                // Unmarshal - Convert native data to managed data.
                newStore = __newStore_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __newStore_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxResetForSignatureError", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ctx_native, nint* __newStore_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypto
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27405")]
        private static partial global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle X509StoreCtxGetSharedUntrusted_private(global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle ctx)
        {
            bool __invokeSucceeded = default;
            nint __ctx_native = default;
            global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeSharedX509StackHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeX509StoreCtxHandle>.ManagedToUnmanagedIn __ctx_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ctx_native__marshaller.FromManaged(ctx);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ctx_native = __ctx_native__marshaller.ToUnmanaged();
                    __retVal_native = __PInvoke(__ctx_native);
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ctx_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_X509StoreCtxGetSharedUntrusted", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ctx_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ssl
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Security.Cryptography.Native.OpenSsl", EntryPoint = "CryptoNative_EnsureLibSslInitialized", ExactSpelling = true)]
        internal static extern partial void EnsureLibSslInitialized();
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ConvertErrorPlatformToPal", ExactSpelling = true)]
        internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ConvertErrorPalToPlatform", ExactSpelling = true)]
        internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_StrErrorR", ExactSpelling = true)]
        private static unsafe extern partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetSocketAddressSizes", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error GetSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize, int* udsSocketAddressSize, int* maxSocketAddressSize);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetAddressFamily", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_SetAddressFamily", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetPort", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_SetPort", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error SetPort(byte* socketAddress, int socketAddressLen, ushort port);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetIPv4Address", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_SetIPv4Address", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetIPv6Address", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error GetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint* scopeId);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_SetIPv6Address", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error SetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint scopeId);
    }
}