You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// var cpdef = pChainParameters.GetValueOrDefault();
3065
+
// if (!CertSelectCertificateChains(pSelectionContext, dwFlags, pChainParameters.HasValue ? &cpdef : null, rgpCriteria?.Length ?? 0, rgpCriteria, hStore, out var cSelections, out var ppSelections))
// [In, Optional, MarshalAs(UnmanagedType.LPArray)] CERT_SELECT_CRITERIA[]? rgpCriteria, HCERTSTORE hStore, out int pcSelection, out CERT_CHAIN_CONTEXT*[] pprgpSelection);
3077
+
3060
3078
/// <summary>
3061
3079
/// The <c>CertSerializeCertificateStoreElement</c> function serializes a certificate context's encoded certificate and its encoded
3062
3080
/// properties. The result can be persisted to storage so that the certificate and properties can be retrieved at a later time.
@@ -3630,191 +3648,8 @@ public struct CERT_TRUST_LIST_INFO
3630
3648
publicPCCTL_CONTEXTpCtlContext;
3631
3649
}
3632
3650
3633
-
/// <summary>Provides a handle to an online certificate status protocol (OCSP) response.</summary>
// var cpdef = pChainParameters.GetValueOrDefault();
3686
-
// if (!CertSelectCertificateChains(pSelectionContext, dwFlags, pChainParameters.HasValue ? &cpdef : null, rgpCriteria?.Length ?? 0, rgpCriteria, hStore, out var cSelections, out var ppSelections))
// [In, Optional, MarshalAs(UnmanagedType.LPArray)] CERT_SELECT_CRITERIA[]? rgpCriteria, HCERTSTORE hStore, out int pcSelection, out CERT_CHAIN_CONTEXT*[] pprgpSelection);
3698
-
3699
-
/// <summary>Provides a handle to a Certificate Chain Engine.</summary>
3700
-
[StructLayout(LayoutKind.Sequential)]
3701
-
publicreadonlystructHCERTCHAINENGINE:IHandle
3702
-
{
3703
-
privatereadonlyIntPtrhandle;
3704
-
3705
-
/// <summary>Initializes a new instance of the <see cref="HCERTCHAINENGINE"/> struct.</summary>
3706
-
/// <param name="preexistingHandle">An <see cref="IntPtr"/> object that represents the pre-existing handle to use.</param>
/// <summary>Provides a <see cref="SafeHandle"/> for <see cref="PCCERT_CONTEXT"/> that is disposed using <see cref="CertFreeCertificateContext"/>.</summary>
3798
-
publicclassSafePCCERT_CONTEXT:SafeHANDLE
3651
+
publicpartialclassSafePCCERT_CONTEXT
3799
3652
{
3800
-
/// <summary>Represents a NULL handle for <see cref="SafePCCERT_CONTEXT"/>. This must be used instead of <see langword="null"/>.</summary>
/// Provides a <see cref="SafeHandle"/> for <see cref="PCCERT_SERVER_OCSP_RESPONSE_CONTEXT"/> that is disposed using <see cref="CertFreeServerOcspResponseContext"/>.
/// <summary>Performs an implicit conversion from <see cref="SafePCCERT_SERVER_OCSP_RESPONSE_CONTEXT"/> to <see cref="PCCERT_SERVER_OCSP_RESPONSE_CONTEXT"/>.</summary>
/// <summary>If the handle refers to a session key, or to a public key that has been imported into the <c>cryptographic service provider</c> (CSP) through <c>CryptImportKey</c>, this function destroys the key and frees the memory that the key used. Many CSPs overwrite the memory where the key was held before freeing it. However, the underlying <c>public/private key pair</c> is not destroyed by this function. Only the handle is destroyed.</summary>
1502
+
/// <param name="hKey">The handle of the key to be destroyed.</param>
1503
+
/// <returns>
1504
+
/// <para>If the function succeeds, the return value is nonzero.</para>
1505
+
/// <para>If the function fails, the return value is zero. For extended error information, call <c>GetLastError</c>.</para>
1506
+
/// <para>The error codes prefaced by "NTE" are generated by the particular CSP being used. Some possible error codes are listed in the following table.</para>
1507
+
/// <list type="table">
1508
+
/// <listheader>
1509
+
/// <description>Return code</description>
1510
+
/// <description>Description</description>
1511
+
/// </listheader>
1512
+
/// <item>
1513
+
/// <description><b>ERROR_BUSY</b></description>
1514
+
/// <description>The key object specified by <i>hKey</i> is currently being used and cannot be destroyed.</description>
/// <description>The <i>hKey</i> parameter contains a value that is not valid.</description>
1523
+
/// </item>
1524
+
/// <item>
1525
+
/// <description><b>NTE_BAD_KEY</b></description>
1526
+
/// <description>The <i>hKey</i> parameter does not contain a valid handle to a key.</description>
1527
+
/// </item>
1528
+
/// <item>
1529
+
/// <description><b>NTE_BAD_UID</b></description>
1530
+
/// <description>The CSP context that was specified when the key was created cannot be found.</description>
1531
+
/// </item>
1532
+
/// </list>
1533
+
/// </returns>
1534
+
/// <remarks>
1535
+
/// <para>Keys take up both operating system's memory space and the CSP's memory space. Some CSPs are implemented in hardware with limited memory resources. Applications must destroy all keys with the <b>CryptDestroyKey</b> function when they are finished with them.</para>
1536
+
/// <para>All key handles that have been created or imported by using a specific CSP must be destroyed before that CSP handle is released with the <c>CryptReleaseContext</c> function.</para>
1537
+
/// <para>Examples</para>
1538
+
/// <para>For an example that uses the <b>CryptDestroyKey</b> function, see <c>Example C Program: Creating and Hashing a Session Key</c>.</para>
0 commit comments