cryptmsg.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:PythonForWindows 作者: hakril 项目源码 文件源码
def get_param(self, param_type, index=0):
        data_size = gdef.DWORD()
        # https://msdn.microsoft.com/en-us/library/windows/desktop/aa380227(v=vs.85).aspx
        winproxy.CryptMsgGetParam(self, param_type, index, None, data_size)
        buffer = ctypes.c_buffer(data_size.value)
        winproxy.CryptMsgGetParam(self, param_type, index, buffer, data_size)

        if param_type in self.MSG_PARAM_KNOW_TYPES:
            buffer = self.MSG_PARAM_KNOW_TYPES[param_type].from_buffer(buffer)
        if isinstance(buffer, gdef.DWORD): # DWORD -> return the Python int
            return buffer.value
        return buffer


    # Certificate accessors
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号