C# Class Interop.crypt32

Mostrar archivo Open project: dotnet/corefx

Public Methods

Method Description
CertEnumCertificatesInStore ( SafeCertStoreHandle hCertStore, SafeCertContextHandle &pCertContext ) : bool

A less error-prone wrapper for CertEnumCertificatesInStore(). To begin the enumeration, set pCertContext to null. Each iteration replaces pCertContext with the next certificate in the iteration. The final call sets pCertContext to an invalid SafeCertStoreHandle and returns "false" to indicate the end of the store has been reached.

CertFindCertificateInStore ( SafeCertStoreHandle hCertStore, CertFindType dwFindType, void pvFindPara, SafeCertContextHandle &pCertContext ) : bool

A less error-prone wrapper for CertEnumCertificatesInStore(). To begin the enumeration, set pCertContext to null. Each iteration replaces pCertContext with the next certificate in the iteration. The final call sets pCertContext to an invalid SafeCertStoreHandle and returns "false" to indicate the end of the store has been reached.

CertGetCertificateChain ( ChainEngine hChainEngine, SafeCertContextHandle pCertContext, FILETIME pTime, SafeCertStoreHandle hStore, [ pChainPara, CertChainFlags dwFlags, IntPtr pvReserved, SafeX509ChainHandle &ppChainContext ) : bool
CertOpenStore ( CertStoreProvider lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, string pvPara ) : SafeCertStoreHandle
CertVerifyCertificateChainPolicy ( ChainPolicy pszPolicyOID, SafeX509ChainHandle pChainContext, CERT_CHAIN_POLICY_PARA &pPolicyPara, CERT_CHAIN_POLICY_STATUS &pPolicyStatus ) : bool
CryptDecodeObject ( CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, byte pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte pvStructInfo, int &pcbStructInfo ) : bool
CryptDecodeObjectPointer ( CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, byte pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, void pvStructInfo, int &pcbStructInfo ) : bool
CryptEncodeObject ( CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, void pvStructInfo, byte pbEncoded, int &pcbEncoded ) : bool
CryptFormatObject ( CertEncodingType dwCertEncodingType, FormatObjectType dwFormatType, FormatObjectStringType dwFormatStrType, IntPtr pFormatStruct, FormatObjectStructType lpszStructType, byte pbEncoded, int cbEncoded, StringBuilder pbFormat, int &pcbFormat ) : bool
EncodeObject ( CryptDecodeObjectStructType lpszStructType, void decoded ) : byte[]
EncodeObject ( string lpszStructType, void decoded ) : byte[]

Private Methods

Method Description
CertAddCertificateContextToStore ( SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext ) : bool
CertAddCertificateLinkToStore ( SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext ) : bool
CertCloseStore ( IntPtr hCertStore, int dwFlags ) : bool
CertControlStore ( SafeCertStoreHandle hCertStore, CertControlStoreFlags dwFlags, CertControlStoreType dwControlType, IntPtr pvCtrlPara ) : bool
CertDeleteCertificateFromStore ( CERT_CONTEXT pCertContext ) : bool
CertDuplicateCertificateChain ( IntPtr pChainContext ) : SafeX509ChainHandle
CertDuplicateCertificateContext ( IntPtr pCertContext ) : SafeCertContextHandle
CertDuplicateCertificateContextWithKeyContainerDeletion ( IntPtr pCertContext ) : SafeCertContextHandleWithKeyContainerDeletion
CertDuplicateStore ( IntPtr hCertStore ) : SafeCertStoreHandle
CertEnumCertificatesInStore ( SafeCertStoreHandle hCertStore, CERT_CONTEXT pPrevCertContext ) : SafeCertContextHandle
CertFindCertificateInStore ( SafeCertStoreHandle hCertStore, CertEncodingType dwCertEncodingType, CertFindFlags dwFindFlags, CertFindType dwFindType, void pvFindPara, CERT_CONTEXT pPrevCertContext ) : SafeCertContextHandle
CertFindExtension ( [ pszObjId, int cExtensions, CERT_EXTENSION rgExtensions ) : CERT_EXTENSION*
CertFreeCertificateChain ( IntPtr pChainContext ) : void
CertFreeCertificateContext ( IntPtr pCertContext ) : bool
CertGetCertificateChain ( IntPtr hChainEngine, SafeCertContextHandle pCertContext, FILETIME pTime, SafeCertStoreHandle hStore, [ pChainPara, CertChainFlags dwFlags, IntPtr pvReserved, SafeX509ChainHandle &ppChainContext ) : bool
CertGetCertificateContextProperty ( SafeCertContextHandle pCertContext, CertContextPropId dwPropId, [ pvData, [ pcbData ) : bool
CertGetCertificateContextPropertyString ( SafeCertContextHandle pCertContext, CertContextPropId dwPropId, [ pvData, [ pcbData ) : bool
CertGetIntendedKeyUsage ( CertEncodingType dwCertEncodingType, CERT_INFO pCertInfo, System.Security.Cryptography.X509Certificates.X509KeyUsageFlags &pbKeyUsage, int cbKeyUsage ) : bool
CertGetNameString ( SafeCertContextHandle pCertContext, CertNameType dwType, CertNameFlags dwFlags, [ pvTypePara, [ pszNameString, int cchNameString ) : int
CertGetValidUsages ( int cCerts, [ rghCerts, int &cNumOIDs, [ rghOIDs, [ pcbOIDs ) : bool
CertNameToStr ( CertEncodingType dwCertEncodingType, [ pName, CertNameStrTypeAndFlags dwStrType, StringBuilder psz, int csz ) : int
CertOpenStore ( IntPtr lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, [ pvPara ) : SafeCertStoreHandle
CertSaveStore ( SafeCertStoreHandle hCertStore, CertEncodingType dwMsgAndCertEncodingType, CertStoreSaveAs dwSaveAs, CertStoreSaveTo dwSaveTo, CRYPTOAPI_BLOB &pvSaveToPara, int dwFlags ) : bool
CertSerializeCertificateStoreElement ( SafeCertContextHandle pCertContext, int dwFlags, [ pbElement, [ pcbElement ) : bool
CertSetCertificateContextProperty ( SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, [ pvData ) : bool
CertStrToName ( CertEncodingType dwCertEncodingType, string pszX500, CertNameStrTypeAndFlags dwStrType, IntPtr pvReserved, [ pbEncoded, [ pcbEncoded, IntPtr ppszError ) : bool
CertVerifyCertificateChainPolicy ( IntPtr pszPolicyOID, SafeX509ChainHandle pChainContext, [ pPolicyPara, [ pPolicyStatus ) : bool
CertVerifyTimeValidity ( [ pTimeToVerify, [ pCertInfo ) : int
CryptAcquireCertificatePrivateKey ( SafeCertContextHandle pCert, CryptAcquireFlags dwFlags, IntPtr pvParameters, Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle &phCryptProvOrNCryptKey, int &pdwKeySpec, bool &pfCallerFreeProvOrNCryptKey ) : bool
CryptDecodeObject ( CertEncodingType dwCertEncodingType, IntPtr lpszStructType, [ pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, [ pvStructInfo, [ pcbStructInfo ) : bool
CryptDecodeObjectPointer ( CertEncodingType dwCertEncodingType, IntPtr lpszStructType, [ pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, [ pvStructInfo, [ pcbStructInfo ) : bool
CryptDecodeObjectPointer ( CertEncodingType dwCertEncodingType, [ lpszStructType, [ pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, [ pvStructInfo, [ pcbStructInfo ) : bool
CryptEncodeObject ( CertEncodingType dwCertEncodingType, IntPtr lpszStructType, void pvStructInfo, [ pbEncoded, [ pcbEncoded ) : bool
CryptEncodeObject ( CertEncodingType dwCertEncodingType, [ lpszStructType, void pvStructInfo, [ pbEncoded, [ pcbEncoded ) : bool
CryptFormatObject ( CertEncodingType dwCertEncodingType, FormatObjectType dwFormatType, FormatObjectStringType dwFormatStrType, IntPtr pFormatStruct, IntPtr lpszStructType, [ pbEncoded, int cbEncoded, [ pbFormat, [ pcbFormat ) : bool
CryptHashPublicKeyInfo ( IntPtr hCryptProv, int algId, int dwFlags, CertEncodingType dwCertEncodingType, [ pInfo, [ pbComputedHash, [ pcbComputedHash ) : bool
CryptImportPublicKeyInfoEx2 ( CertEncodingType dwCertEncodingType, CERT_PUBLIC_KEY_INFO pInfo, int dwFlags, void pvAuxInfo, Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle &phKey ) : bool
CryptMsgClose ( IntPtr hCryptMsg ) : bool
CryptMsgGetParam ( SafeCryptMsgHandle hCryptMsg, CryptMessageParameterType dwParamType, int dwIndex, [ pvData, [ pcbData ) : bool
CryptMsgGetParam ( SafeCryptMsgHandle hCryptMsg, CryptMessageParameterType dwParamType, int dwIndex, int &pvData, [ pcbData ) : bool
CryptQueryObject ( CertQueryObjectType dwObjectType, void pvObject, ExpectedContentTypeFlags dwExpectedContentTypeFlags, ExpectedFormatTypeFlags dwExpectedFormatTypeFlags, int dwFlags, CertEncodingType &pdwMsgAndCertEncodingType, ContentType, &pdwContentType, FormatType &pdwFormatType, SafeCertStoreHandle &phCertStore, SafeCryptMsgHandle &phMsg, SafeCertContextHandle &ppvContext ) : bool
CryptQueryObject ( CertQueryObjectType dwObjectType, void pvObject, ExpectedContentTypeFlags dwExpectedContentTypeFlags, ExpectedFormatTypeFlags dwExpectedFormatTypeFlags, int dwFlags, IntPtr pdwMsgAndCertEncodingType, ContentType, &pdwContentType, IntPtr pdwFormatType, IntPtr phCertStore, IntPtr phMsg, IntPtr ppvContext ) : bool
CryptQueryObject ( CertQueryObjectType dwObjectType, void pvObject, ExpectedContentTypeFlags dwExpectedContentTypeFlags, ExpectedFormatTypeFlags dwExpectedFormatTypeFlags, int dwFlags, IntPtr pdwMsgAndCertEncodingType, ContentType, &pdwContentType, IntPtr pdwFormatType, SafeCertStoreHandle &phCertStore, IntPtr phMsg, IntPtr ppvContext ) : bool
PFXExportCertStore ( SafeCertStoreHandle hStore, [ pPFX, SafePasswordHandle szPassword, PFXExportFlags dwFlags ) : bool
PFXImportCertStore ( [ pPFX, SafePasswordHandle password, PfxCertStoreFlags dwFlags ) : SafeCertStoreHandle

Method Details

CertEnumCertificatesInStore() public static method

A less error-prone wrapper for CertEnumCertificatesInStore(). To begin the enumeration, set pCertContext to null. Each iteration replaces pCertContext with the next certificate in the iteration. The final call sets pCertContext to an invalid SafeCertStoreHandle and returns "false" to indicate the end of the store has been reached.
public static CertEnumCertificatesInStore ( SafeCertStoreHandle hCertStore, SafeCertContextHandle &pCertContext ) : bool
hCertStore SafeCertStoreHandle
pCertContext SafeCertContextHandle
return bool

CertFindCertificateInStore() public static method

A less error-prone wrapper for CertEnumCertificatesInStore(). To begin the enumeration, set pCertContext to null. Each iteration replaces pCertContext with the next certificate in the iteration. The final call sets pCertContext to an invalid SafeCertStoreHandle and returns "false" to indicate the end of the store has been reached.
public static CertFindCertificateInStore ( SafeCertStoreHandle hCertStore, CertFindType dwFindType, void pvFindPara, SafeCertContextHandle &pCertContext ) : bool
hCertStore SafeCertStoreHandle
dwFindType CertFindType
pvFindPara void
pCertContext SafeCertContextHandle
return bool

CertGetCertificateChain() public static method

public static CertGetCertificateChain ( ChainEngine hChainEngine, SafeCertContextHandle pCertContext, FILETIME pTime, SafeCertStoreHandle hStore, [ pChainPara, CertChainFlags dwFlags, IntPtr pvReserved, SafeX509ChainHandle &ppChainContext ) : bool
hChainEngine ChainEngine
pCertContext SafeCertContextHandle
pTime FILETIME
hStore SafeCertStoreHandle
pChainPara [
dwFlags CertChainFlags
pvReserved IntPtr
ppChainContext Microsoft.Win32.SafeHandles.SafeX509ChainHandle
return bool

CertOpenStore() public static method

public static CertOpenStore ( CertStoreProvider lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, string pvPara ) : SafeCertStoreHandle
lpszStoreProvider CertStoreProvider
dwMsgAndCertEncodingType CertEncodingType
hCryptProv IntPtr
dwFlags CertStoreFlags
pvPara string
return SafeCertStoreHandle

CertVerifyCertificateChainPolicy() public static method

public static CertVerifyCertificateChainPolicy ( ChainPolicy pszPolicyOID, SafeX509ChainHandle pChainContext, CERT_CHAIN_POLICY_PARA &pPolicyPara, CERT_CHAIN_POLICY_STATUS &pPolicyStatus ) : bool
pszPolicyOID ChainPolicy
pChainContext Microsoft.Win32.SafeHandles.SafeX509ChainHandle
pPolicyPara Internal.Cryptography.Pal.Native.CERT_CHAIN_POLICY_PARA
pPolicyStatus Internal.Cryptography.Pal.Native.CERT_CHAIN_POLICY_STATUS
return bool

CryptDecodeObject() public static method

public static CryptDecodeObject ( CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, byte pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte pvStructInfo, int &pcbStructInfo ) : bool
dwCertEncodingType CertEncodingType
lpszStructType CryptDecodeObjectStructType
pbEncoded byte
cbEncoded int
dwFlags CryptDecodeObjectFlags
pvStructInfo byte
pcbStructInfo int
return bool

CryptDecodeObjectPointer() public static method

public static CryptDecodeObjectPointer ( CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, byte pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, void pvStructInfo, int &pcbStructInfo ) : bool
dwCertEncodingType CertEncodingType
lpszStructType CryptDecodeObjectStructType
pbEncoded byte
cbEncoded int
dwFlags CryptDecodeObjectFlags
pvStructInfo void
pcbStructInfo int
return bool

CryptEncodeObject() public static method

public static CryptEncodeObject ( CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, void pvStructInfo, byte pbEncoded, int &pcbEncoded ) : bool
dwCertEncodingType CertEncodingType
lpszStructType CryptDecodeObjectStructType
pvStructInfo void
pbEncoded byte
pcbEncoded int
return bool

CryptFormatObject() public static method

public static CryptFormatObject ( CertEncodingType dwCertEncodingType, FormatObjectType dwFormatType, FormatObjectStringType dwFormatStrType, IntPtr pFormatStruct, FormatObjectStructType lpszStructType, byte pbEncoded, int cbEncoded, StringBuilder pbFormat, int &pcbFormat ) : bool
dwCertEncodingType CertEncodingType
dwFormatType FormatObjectType
dwFormatStrType FormatObjectStringType
pFormatStruct IntPtr
lpszStructType FormatObjectStructType
pbEncoded byte
cbEncoded int
pbFormat StringBuilder
pcbFormat int
return bool

EncodeObject() public static method

public static EncodeObject ( CryptDecodeObjectStructType lpszStructType, void decoded ) : byte[]
lpszStructType CryptDecodeObjectStructType
decoded void
return byte[]

EncodeObject() public static method

public static EncodeObject ( string lpszStructType, void decoded ) : byte[]
lpszStructType string
decoded void
return byte[]