本文整理汇总了Python中tlslite.handshakesettings.HandshakeSettings.minKeySize方法的典型用法代码示例。如果您正苦于以下问题:Python HandshakeSettings.minKeySize方法的具体用法?Python HandshakeSettings.minKeySize怎么用?Python HandshakeSettings.minKeySize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlslite.handshakesettings.HandshakeSettings
的用法示例。
在下文中一共展示了HandshakeSettings.minKeySize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_maxKeySize_smaller_than_minKeySize
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import minKeySize [as 别名]
def test_maxKeySize_smaller_than_minKeySize(self):
hs = HandshakeSettings()
hs.maxKeySize = 1024
hs.minKeySize = 2048
with self.assertRaises(ValueError):
hs.validate()
示例2: test_client_SRP_key_exchange_with_too_small_params
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import minKeySize [as 别名]
def test_client_SRP_key_exchange_with_too_small_params(self):
keyExchange = self.keyExchange.makeServerKeyExchange('sha1')
settings = HandshakeSettings()
settings.minKeySize = 3072
client_keyExchange = SRPKeyExchange(self.cipher_suite,
self.client_hello,
self.server_hello,
None, None,
srpUsername=bytearray(b'user'),
password=bytearray(b'password'),
settings=settings)
with self.assertRaises(TLSInsufficientSecurity):
client_keyExchange.processServerKeyExchange(None, keyExchange)
示例3: test_client_SRP_key_exchange_with_too_big_params
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import minKeySize [as 别名]
def test_client_SRP_key_exchange_with_too_big_params(self):
keyExchange = self.keyExchange.makeServerKeyExchange('sha1')
settings = HandshakeSettings()
settings.minKeySize = 512
settings.maxKeySize = 1024
client_keyExchange = SRPKeyExchange(self.cipher_suite,
self.client_hello,
self.server_hello,
None, None,
srpUsername='user',
password='password',
settings=settings)
with self.assertRaises(TLSInsufficientSecurity):
client_keyExchange.processServerKeyExchange(None, keyExchange)
示例4: test_minKeySize_too_large
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import minKeySize [as 别名]
def test_minKeySize_too_large(self):
hs = HandshakeSettings()
hs.minKeySize = 16385
with self.assertRaises(ValueError):
hs.validate()
示例5: test_minKeySize_too_small
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import minKeySize [as 别名]
def test_minKeySize_too_small(self):
hs = HandshakeSettings()
hs.minKeySize = 511
with self.assertRaises(ValueError):
hs.validate()