win32crypt.CryptQueryObject

dict = CryptQueryObject(ObjectType, Object , ExpectedContentTypeFlags , ExpectedFormatTypeFlags , Flags )

Determines the cryptographic type of input data

Parameters

ObjectType : int

Type of input, CERT_QUERY_OBJECT_BLOB or CERT_QUERY_OBJECT_FILE

Object : str

Raw data or a filename containing the data to be queried depending on ObjectType

ExpectedContentTypeFlags=CERT_QUERY_CONTENT_FLAG_ALL : int

One of the CERT_QUERY_CONTENT_FLAG_* constants

ExpectedFormatTypeFlags=CERT_QUERY_FORMAT_FLAG_ALL : int

One of the CERT_QUERY_FORMAT_FLAG_* constants

Flags=0 : int

Reserved, use only 0

Return Value

Returns a dictionary containing
{MsgAndCertEncodingType:int, ## encoding type, usually X509_ASN_ENCODING combined with PKCS_7_ASN_ENCODING
ContentType:int, ## One of the CERT_QUERY_CONTENT_* constants
FormatType:int, ## One of the CERT_QUERY_FORMAT_* constants
CertStore:PyCERTSTORE, ## Handle to certificate store containing all certficates in the object, may be None
Msg:PyCRYPTMSG, ## If input doesn't contains a PKCS7 message, will be None
Context:PyCERT_CONTEXT} ## A certificate, CRL, or CTL context depending on ContentType, may be None