当前位置: 首页>>代码示例>>Python>>正文


Python Message.createFromValues方法代码示例

本文整理汇总了Python中Message.Message.createFromValues方法的典型用法代码示例。如果您正苦于以下问题:Python Message.createFromValues方法的具体用法?Python Message.createFromValues怎么用?Python Message.createFromValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Message.Message的用法示例。


在下文中一共展示了Message.createFromValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createFromValues

# 需要导入模块: from Message import Message [as 别名]
# 或者: from Message.Message import createFromValues [as 别名]
 def createFromValues(self, taskid, ts, hmac, certhash, trace):
     # set message type and length (72B for taskid, ts, hmac and
     # certhash plus length of traceroute)
     Message.createFromValues(self, messageTypes["TASK_REPLY_KNOWN_CERT"], 72 + len(trace))
     self.taskid = taskid
     self.ts = ts
     self.hmac = hmac
     self.certhash = certhash
     self.trace = trace
开发者ID:crossbear,项目名称:Crossbear,代码行数:11,代码来源:HTRepKnownCert.py

示例2: createFromValues

# 需要导入模块: from Message import Message [as 别名]
# 或者: from Message.Message import createFromValues [as 别名]
 def createFromValues(self, taskid, ts, hmac, certchain, trace):
     # Convert certs to DER
     self.certchain = []
     for cert in certchain[:min(255,len(certchain))]:
         self.certchain.append(ssl.PEM_cert_to_DER_cert(cert))
     certlength = sum(len(x) for x in self.certchain)
     # set message type and length ( 41 Bytes for taskid, ts, hmac and number of certificates
     # plus length of trace and length of cert chain.
     Message.createFromValues(self, messageTypes['TASK_REPLY_NEW_CERT'], 41 + len(trace) + certlength)
     self.taskid    = taskid
     self.ts        = ts
     self.hmac      = hmac
     self.trace     = trace
开发者ID:UCASREN,项目名称:Crossbear,代码行数:15,代码来源:HTRepNewCert.py

示例3: createFromValues

# 需要导入模块: from Message import Message [as 别名]
# 或者: from Message.Message import createFromValues [as 别名]
    def createFromValues(self, options, certs, hostname, ip, port):
        self.certchain = []
        chainlength = 0
        for cert in certs:
            derobj = ssl.PEM_cert_to_DER_cert(cert)
            chainlength += len(derobj)
            self.certchain.append(derobj)

        Message.createFromValues(self, messageTypes['CERT_VERIFY_REQUEST'], 4 + chainlength + len(hostname) + len(ip) + len(str(port)))
        self.options = options
        self.hostname = hostname
        self.ip = ip
        self.port = port
开发者ID:UCASREN,项目名称:Crossbear,代码行数:15,代码来源:CertVerifyReq.py

示例4: createFromValues

# 需要导入模块: from Message import Message [as 别名]
# 或者: from Message.Message import createFromValues [as 别名]
 def createFromValues(self, data):
     Message.createFromValues(self, messageTypes["SIGNATURE"], len(data))
     self.data = data
开发者ID:UCASREN,项目名称:Crossbear,代码行数:5,代码来源:SignatureMessage.py


注:本文中的Message.Message.createFromValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。