本文整理汇总了Python中tlsfuzzer.runner.ConnectionState.handshake_messages方法的典型用法代码示例。如果您正苦于以下问题:Python ConnectionState.handshake_messages方法的具体用法?Python ConnectionState.handshake_messages怎么用?Python ConnectionState.handshake_messages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlsfuzzer.runner.ConnectionState
的用法示例。
在下文中一共展示了ConnectionState.handshake_messages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_generate_TLS_1_2_with_cert_request
# 需要导入模块: from tlsfuzzer.runner import ConnectionState [as 别名]
# 或者: from tlsfuzzer.runner.ConnectionState import handshake_messages [as 别名]
def test_generate_TLS_1_2_with_cert_request(self):
priv_key = generateRSAKey(1024)
cert_ver_g = CertificateVerifyGenerator(priv_key)
state = ConnectionState()
state.version = (3, 3)
req = CertificateRequest((3, 3)).create([], [],
[(constants.HashAlgorithm.sha256,
constants.SignatureAlgorithm.rsa),
(constants.HashAlgorithm.sha1,
constants.SignatureAlgorithm.rsa)])
state.handshake_messages = [req]
msg = cert_ver_g.generate(state)
self.assertIsNotNone(msg)
self.assertEqual(len(msg.signature), 128)
self.assertEqual(msg.signatureAlgorithm,
(constants.HashAlgorithm.sha256,
constants.SignatureAlgorithm.rsa))