本文整理汇总了Python中tlslite.handshakesettings.HandshakeSettings.validate方法的典型用法代码示例。如果您正苦于以下问题:Python HandshakeSettings.validate方法的具体用法?Python HandshakeSettings.validate怎么用?Python HandshakeSettings.validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlslite.handshakesettings.HandshakeSettings
的用法示例。
在下文中一共展示了HandshakeSettings.validate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_minVersion_higher_than_maxVersion
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_minVersion_higher_than_maxVersion(self):
hs = HandshakeSettings()
hs.minVersion = (3, 3)
hs.maxVersion = (3, 0)
with self.assertRaises(ValueError):
hs.validate()
示例2: test_requireExtendedMasterSecret_with_incompatible_use_EMS
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_requireExtendedMasterSecret_with_incompatible_use_EMS(self):
hs = HandshakeSettings()
hs.useExtendedMasterSecret = False
hs.requireExtendedMasterSecret = True
with self.assertRaises(ValueError):
hs.validate()
示例3: test_maxKeySize_smaller_than_minKeySize
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_maxKeySize_smaller_than_minKeySize(self):
hs = HandshakeSettings()
hs.maxKeySize = 1024
hs.minKeySize = 2048
with self.assertRaises(ValueError):
hs.validate()
示例4: test_cipherNames_with_unknown_name
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_cipherNames_with_unknown_name(self):
hs = HandshakeSettings()
hs.cipherNames = ["aes256"]
newHs = hs.validate()
self.assertEqual(["aes256"], newHs.cipherNames)
示例5: test_requireExtendedMasterSecret
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_requireExtendedMasterSecret(self):
hs = HandshakeSettings()
self.assertFalse(hs.requireExtendedMasterSecret)
hs.requireExtendedMasterSecret = True
n_hs = hs.validate()
self.assertTrue(n_hs.requireExtendedMasterSecret)
示例6: test_useEncryptThenMAC
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_useEncryptThenMAC(self):
hs = HandshakeSettings()
self.assertTrue(hs.useEncryptThenMAC)
hs.useEncryptThenMAC = False
n_hs = hs.validate()
self.assertFalse(n_hs.useEncryptThenMAC)
示例7: test_maxVersion_without_TLSv1_2
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_maxVersion_without_TLSv1_2(self):
hs = HandshakeSettings()
hs.maxVersion = (3, 2)
self.assertTrue("sha256" in hs.macNames)
new_hs = hs.validate()
self.assertFalse("sha256" in new_hs.macNames)
示例8: test_maxVersion_with_unknown_version
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_maxVersion_with_unknown_version(self):
hs = HandshakeSettings()
hs.maxVersion = (3, 4)
with self.assertRaises(ValueError):
hs.validate()
示例9: test_invalid_signature_algorithm
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_invalid_signature_algorithm(self):
hs = HandshakeSettings()
hs.rsaSigHashes += ['md2']
with self.assertRaises(ValueError):
hs.validate()
示例10: test_invalid_dhGroups
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_invalid_dhGroups(self):
hs = HandshakeSettings()
hs.dhGroups = ["ffdhe2048", "ffdhe1024"]
with self.assertRaises(ValueError):
hs.validate()
示例11: test_useEncryptThenMAC_with_wrong_value
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_useEncryptThenMAC_with_wrong_value(self):
hs = HandshakeSettings()
hs.useEncryptThenMAC = None
with self.assertRaises(ValueError):
hs.validate()
示例12: test_cipherNames_empty
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_cipherNames_empty(self):
hs = HandshakeSettings()
hs.cipherNames = []
with self.assertRaises(ValueError):
hs.validate()
示例13: test_certificateTypes_with_unknown_type
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_certificateTypes_with_unknown_type(self):
hs = HandshakeSettings()
hs.certificateTypes = [0, 42]
with self.assertRaises(ValueError):
hs.validate()
示例14: test_requireExtendedMasterSecret_with_wrong_value
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_requireExtendedMasterSecret_with_wrong_value(self):
hs = HandshakeSettings()
hs.requireExtendedMasterSecret = None
with self.assertRaises(ValueError):
hs.validate()
示例15: test_maxKeySize_too_large
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import validate [as 别名]
def test_maxKeySize_too_large(self):
hs = HandshakeSettings()
hs.maxKeySize = 16385
with self.assertRaises(ValueError):
hs.validate()