From 4927ad6b7413c5ef6d91fb264c00e350e3a15a8b Mon Sep 17 00:00:00 2001 From: Troy Dai Date: Thu, 14 Jul 2016 16:24:33 -0700 Subject: [PATCH] Remove win32.cs --- .../Win32.cs | 96 ------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.Authentication/Win32.cs diff --git a/src/Microsoft.AspNetCore.Authentication/Win32.cs b/src/Microsoft.AspNetCore.Authentication/Win32.cs deleted file mode 100644 index 8752c3b734..0000000000 --- a/src/Microsoft.AspNetCore.Authentication/Win32.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - - -using System; -using System.Runtime.InteropServices; - -namespace Microsoft.Win32 -{ - // TODO: ? [Localizable(false)] - internal static class NativeMethods - { - // ReSharper disable InconsistentNaming - public const int X509_ASN_ENCODING = 0x00000001; - public const int X509_PUBLIC_KEY_INFO = 8; - // ReSharper restore InconsistentNaming - - /// - /// Encodes a structure of the type indicated by the value of the lpszStructType parameter. - /// - /// Type of encoding used. - /// The high-order word is zero, the low-order word specifies the integer identifier for the type of the specified structure so - /// we can use the constants in http://msdn.microsoft.com/en-us/library/windows/desktop/aa378145%28v=vs.85%29.aspx - /// A pointer to the structure to be encoded. - /// A pointer to a buffer to receive the encoded structure. This parameter can be NULL to retrieve the size of this information for memory allocation purposes. - /// A pointer to a DWORD variable that contains the size, in bytes, of the buffer pointed to by the pbEncoded parameter. - /// - [DllImport("crypt32.dll", CharSet = CharSet.Ansi, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CryptEncodeObject( - UInt32 dwCertEncodingType, - IntPtr lpszStructType, - ref CERT_PUBLIC_KEY_INFO pvStructInfo, - byte[] pbEncoded, - ref UInt32 pcbEncoded); - - // ReSharper disable InconsistentNaming - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal struct CRYPT_BLOB - { - public Int32 cbData; - public IntPtr pbData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CERT_CONTEXT - { - public Int32 dwCertEncodingType; - public IntPtr pbCertEncoded; - public Int32 cbCertEncoded; - public IntPtr pCertInfo; - public IntPtr hCertStore; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - internal struct CRYPT_ALGORITHM_IDENTIFIER - { - public string pszObjId; - public CRYPT_BLOB Parameters; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - internal struct CRYPT_BIT_BLOB - { - public Int32 cbData; - public IntPtr pbData; - public Int32 cUnusedBits; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal struct CERT_PUBLIC_KEY_INFO - { - public CRYPT_ALGORITHM_IDENTIFIER Algorithm; - public CRYPT_BIT_BLOB PublicKey; - } - - [StructLayout(LayoutKind.Sequential)] - internal class CERT_INFO - { - public Int32 dwVersion; - public CRYPT_BLOB SerialNumber; - public CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm; - public CRYPT_BLOB Issuer; - public System.Runtime.InteropServices.ComTypes.FILETIME NotBefore; - public System.Runtime.InteropServices.ComTypes.FILETIME NotAfter; - public CRYPT_BLOB Subject; - public CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo; - public CRYPT_BIT_BLOB IssuerUniqueId; - public CRYPT_BIT_BLOB SubjectUniqueId; - public Int32 cExtension; - public IntPtr rgExtension; - } - - // ReSharper restore InconsistentNaming - } -}