-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make System.Security.Cryptography.X509Certificates compliant with int…
…erop guidelines - part 2 Convert more of S.S.C.X509Certificates to use correct interop style.
- Loading branch information
1 parent
7308c4f
commit f7be57f
Showing
46 changed files
with
788 additions
and
444 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_KEY_PROV_INFO_ANSI.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[StructLayout(LayoutKind.Sequential)] | ||
internal unsafe struct CRYPT_KEY_PROV_INFO | ||
{ | ||
internal char* pwszContainerName; | ||
internal char* pwszProvName; | ||
internal int dwProvType; | ||
internal CryptAcquireContextFlags dwFlags; | ||
internal int cProvParam; | ||
internal IntPtr rgProvParam; | ||
internal int dwKeySpec; | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static partial bool CertAddCertificateContextToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] | ||
internal static partial SafeX509ChainHandle CertDuplicateCertificateChain(IntPtr pChainContext); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...nterop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext", CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static partial SafeCertContextHandleWithKeyContainerDeletion CertDuplicateCertificateContextWithKeyContainerDeletion(IntPtr pCertContext); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] | ||
internal static partial SafeCertStoreHandle CertDuplicateStore(IntPtr hCertStore); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...on/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, CERT_CONTEXT* pPrevCertContext); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...ies/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty", CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static unsafe partial bool CertGetCertificateContextPropertyString(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte* pvData, ref int pcbData); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW", CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static unsafe partial int CertGetNameString(SafeCertContextHandle pCertContext, CertNameType dwType, CertNameFlags dwFlags, in CertNameStringType pvTypePara, char* pszNameString, int cchNameString); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameFlags.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[Flags] | ||
internal enum CertNameFlags : int | ||
{ | ||
None = 0x00000000, | ||
CERT_NAME_ISSUER_FLAG = 0x00000001, | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameStringType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
internal enum CertNameStringType : int | ||
{ | ||
CERT_X500_NAME_STR = 3, | ||
CERT_NAME_STR_REVERSE_FLAG = 0x02000000, | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
internal enum CertNameType : int | ||
{ | ||
CERT_NAME_EMAIL_TYPE = 1, | ||
CERT_NAME_RDN_TYPE = 2, | ||
CERT_NAME_ATTR_TYPE = 3, | ||
CERT_NAME_SIMPLE_DISPLAY_TYPE = 4, | ||
CERT_NAME_FRIENDLY_DISPLAY_TYPE = 5, | ||
CERT_NAME_DNS_TYPE = 6, | ||
CERT_NAME_URL_TYPE = 7, | ||
CERT_NAME_UPN_TYPE = 8, | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, [MarshalAs(UnmanagedType.LPWStr)] string? pvPara); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...raries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static partial bool CertSerializeCertificateStoreElement(SafeCertContextHandle pCertContext, int dwFlags, byte[]? pbElement, ref int pcbElement); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
.../Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPT_KEY_PROV_INFO* pvData); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, DATA_BLOB* pvData); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
.../Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, SafeNCryptKeyHandle keyHandle); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetPropertyFlags.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[Flags] | ||
internal enum CertSetPropertyFlags : int | ||
{ | ||
CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG = 0x40000000, | ||
None = 0x00000000, | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreAddDisposition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
internal enum CertStoreAddDisposition : int | ||
{ | ||
CERT_STORE_ADD_NEW = 1, | ||
CERT_STORE_ADD_USE_EXISTING = 2, | ||
CERT_STORE_ADD_REPLACE_EXISTING = 3, | ||
CERT_STORE_ADD_ALWAYS = 4, | ||
CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES = 5, | ||
CERT_STORE_ADD_NEWER = 6, | ||
CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES = 7, | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreFlags.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[Flags] | ||
internal enum CertStoreFlags : int | ||
{ | ||
CERT_STORE_NO_CRYPT_RELEASE_FLAG = 0x00000001, | ||
CERT_STORE_SET_LOCALIZED_NAME_FLAG = 0x00000002, | ||
CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004, | ||
CERT_STORE_DELETE_FLAG = 0x00000010, | ||
CERT_STORE_UNSAFE_PHYSICAL_FLAG = 0x00000020, | ||
CERT_STORE_SHARE_STORE_FLAG = 0x00000040, | ||
CERT_STORE_SHARE_CONTEXT_FLAG = 0x00000080, | ||
CERT_STORE_MANIFOLD_FLAG = 0x00000100, | ||
CERT_STORE_ENUM_ARCHIVED_FLAG = 0x00000200, | ||
CERT_STORE_UPDATE_KEYID_FLAG = 0x00000400, | ||
CERT_STORE_BACKUP_RESTORE_FLAG = 0x00000800, | ||
CERT_STORE_READONLY_FLAG = 0x00008000, | ||
CERT_STORE_OPEN_EXISTING_FLAG = 0x00004000, | ||
CERT_STORE_CREATE_NEW_FLAG = 0x00002000, | ||
CERT_STORE_MAXIMUM_ALLOWED_FLAG = 0x00001000, | ||
CERT_SYSTEM_STORE_CURRENT_USER = 0x00010000, | ||
CERT_SYSTEM_STORE_LOCAL_MACHINE = 0x00020000, | ||
None = 0x00000000, | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW", CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static partial bool CertStrToName(CertEncodingType dwCertEncodingType, string pszX500, CertNameStrTypeAndFlags dwStrType, IntPtr pvReserved, byte[]? pbEncoded, ref int pcbEncoded, IntPtr ppszError); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireContextFlags.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Crypt32 | ||
{ | ||
[Flags] | ||
internal enum CryptAcquireContextFlags : int | ||
{ | ||
CRYPT_DELETEKEYSET = 0x00000010, | ||
CRYPT_MACHINE_KEYSET = 0x00000020, | ||
None = 0x00000000, | ||
} | ||
} | ||
} |
Oops, something went wrong.