def from_file(cls, filename): """Create a new :class:`CertificateStore` from ``filename``""" res = winproxy.CertOpenStore(gdef.CERT_STORE_PROV_FILENAME_A, DEFAULT_ENCODING, None, gdef.CERT_STORE_OPEN_EXISTING_FLAG, filename) return ctypes.cast(res, cls)
def from_system_store(cls, store_name): """Create a new :class:`EHCERTSTORE` from system store``store_name`` (see https://msdn.microsoft.com/en-us/library/windows/desktop/aa388136(v=vs.85).aspx) """ res = winproxy.CertOpenStore( CERT_STORE_PROV_SYSTEM_A, DEFAULT_ENCODING, None, CERT_SYSTEM_STORE_LOCAL_MACHINE | CERT_STORE_READONLY_FLAG, store_name) return ctypes.cast(res, cls)
def new_in_memory(cls): """Create a new temporary :class:`EHCERTSTORE` in memory""" res = winproxy.CertOpenStore(CERT_STORE_PROV_MEMORY, DEFAULT_ENCODING, None, 0, None) return ctypes.cast(res, cls)