(self, filename, content_type=gdef.CERT_QUERY_CONTENT_FLAG_ALL)
| 44 | gdef.CMSG_CERT_COUNT_PARAM: gdef.DWORD} |
| 45 | |
| 46 | def __init__(self, filename, content_type=gdef.CERT_QUERY_CONTENT_FLAG_ALL): |
| 47 | # No other API than filename for now.. |
| 48 | self.filename = filename |
| 49 | |
| 50 | dwEncoding = gdef.DWORD() |
| 51 | dwContentType = gdef.DWORD() |
| 52 | dwFormatType = gdef.DWORD() |
| 53 | hStore = CertificateStore() |
| 54 | hMsg = windows.crypto.CryptMessage() |
| 55 | |
| 56 | winproxy.CryptQueryObject(gdef.CERT_QUERY_OBJECT_FILE, |
| 57 | gdef.LPWSTR(filename), |
| 58 | # filename, |
| 59 | content_type, |
| 60 | gdef.CERT_QUERY_FORMAT_FLAG_BINARY, |
| 61 | 0, |
| 62 | dwEncoding, |
| 63 | dwContentType, |
| 64 | dwFormatType, |
| 65 | hStore, |
| 66 | hMsg, |
| 67 | None) |
| 68 | |
| 69 | self.cert_store = hStore if hStore else None |
| 70 | """The :class:`CertificateStore` that includes all of the certificates, CRLs, and CTLs in the object""" |
| 71 | self.crypt_msg = hMsg if hMsg else None #: yolo |
| 72 | """The :class:`CryptMessage` for any ``PKCS7`` content in the object""" |
| 73 | self.encoding = dwEncoding |
| 74 | self.content_type = CRYPT_OBJECT_FORMAT_TYPE_DICT[dwContentType.value] |
| 75 | """The type of the opened message""" |
| 76 | |
| 77 | def _signers_and_certs_generator(self): |
| 78 | if self.crypt_msg is None: |
nothing calls this directly
no test coverage detected