public static extern bool CryptHashPublicKeyInfo( SafeCryptProviderHandle hCryptProv, CALG Algid, uint dwFlags, CertEncoding dwCertEncodingType, CERT_PUBLIC_KEY_INFO pInfo, byte[] pbComputedHash, out uint pcbComputedHash );
public static extern bool CryptSignAndEncodeCertificate( SafeCryptProviderHandle hCryptProv, CALG dwKeySpec, CertEncoding dwCertEncodingType, IntPtr lpszStructType, IntPtr pvStructInfo, CRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, IntPtr pvHashAuxInfo, byte[] pbEncoded, ref uint pcbEncoded );
internal static extern bool CryptQueryObject( /* _In_ DWORD */ [In] CertQueryObject dwObjectType, /* _In_ const void* */ [In] IntPtr pvObject, /* _In_ DWORD */ [In] CertQueryContentFlag dwExpectedContentTypeFlags, /* _In_ DWORD */ [In] CertQueryFormatFlag dwExpectedFormatTypeFlags, /* _In_ DWORD */ [In] int dwFlags, /* _Out_opt_ DWORD* */ [Out] out CertEncoding pdwMsgAndCertEncodingType, /* _Out_opt_ DWORD* */ [Out] out CertQueryContent pdwContentType, /* _Out_opt_ DWORD* */ [Out] out CertQueryFormat pdwFormatType, /* _Out_opt_ HCERTSTORE* */ [Out] out SafeCertStoreHandle phCertStore, /* _Out_opt_ HCRYPTMSG* */ [Out] out SafeCryptMsgHandle phMsg, /* _Outptr_opt_result_maybenull_ const void** */ [Out] out SafeCertContextHandle ppvContext );
public static extern bool CryptExportPublicKeyInfoEx(SafeCryptProviderHandle hCryptProv, CALG dwKeySpec, CertEncoding dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string pszPublicKeyObjId, uint dwFlags, IntPtr pvAuxInfo, IntPtr pInfo, ref uint pcbInfo);
public static extern bool CryptEncodeObject( CertEncoding dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, IntPtr pvStructInfo, byte[] pbEncoded, ref uint pcbEncoded );
public static extern bool CertStrToName(CertEncoding dwCertEncodingType, string pszX500, CertStringType dwStrType, IntPtr pvReserved, byte[] pbEncoded, ref uint pcbEncoded, IntPtr ppszError);
/// <include file='doc\HttpClientCertificate.uex' path='docs/doc[@for="HttpClientCertificate.Get"]/*' /> /// <devdoc> /// <para>Allows access to individual items in the collection by name.</para> /// </devdoc> public override String Get(String field) { if (field == null) { return(String.Empty); } field = field.ToLower(CultureInfo.InvariantCulture); switch (field) { case "cookie": return(Cookie); case "flags": return(Flags.ToString("G")); case "keysize": return(KeySize.ToString("G")); case "secretkeysize": return(SecretKeySize.ToString()); case "issuer": return(Issuer); case "serverissuer": return(ServerIssuer); case "subject": return(Subject); case "serversubject": return(ServerSubject); case "serialnumber": return(SerialNumber); case "certificate": return(System.Text.Encoding.Default.GetString(Certificate)); case "binaryissuer": return(System.Text.Encoding.Default.GetString(BinaryIssuer)); case "publickey": return(System.Text.Encoding.Default.GetString(PublicKey)); case "encoding": return(CertEncoding.ToString("G")); case "validfrom": return(HttpUtility.FormatHttpDateTime(ValidFrom)); case "validuntil": return(HttpUtility.FormatHttpDateTime(ValidUntil)); } if (field.StartsWith("issuer")) { return(ExtractString(Issuer, field.Substring(6))); } if (field.StartsWith("subject")) { if (field.Equals("subjectemail")) { return(ExtractString(Subject, "e")); } else { return(ExtractString(Subject, field.Substring(7))); } } if (field.StartsWith("serversubject")) { return(ExtractString(ServerSubject, field.Substring(13))); } if (field.StartsWith("serverissuer")) { return(ExtractString(ServerIssuer, field.Substring(12))); } return(String.Empty); }