本文整理汇总了Python中paramiko.ECDSAKey.can_sign方法的典型用法代码示例。如果您正苦于以下问题:Python ECDSAKey.can_sign方法的具体用法?Python ECDSAKey.can_sign怎么用?Python ECDSAKey.can_sign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paramiko.ECDSAKey
的用法示例。
在下文中一共展示了ECDSAKey.can_sign方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_20_compare_ecdsa_521
# 需要导入模块: from paramiko import ECDSAKey [as 别名]
# 或者: from paramiko.ECDSAKey import can_sign [as 别名]
def test_20_compare_ecdsa_521(self):
# verify that the private & public keys compare equal
key = ECDSAKey.from_private_key_file(test_path('test_ecdsa_521.key'))
self.assertEqual(key, key)
pub = ECDSAKey(data=key.asbytes())
self.assertTrue(key.can_sign())
self.assertTrue(not pub.can_sign())
self.assertEqual(key, pub)
示例2: test_12_compare_ecdsa
# 需要导入模块: from paramiko import ECDSAKey [as 别名]
# 或者: from paramiko.ECDSAKey import can_sign [as 别名]
def test_12_compare_ecdsa(self):
# verify that the private & public keys compare equal
key = ECDSAKey.from_private_key_file('tests/test_ecdsa.key')
self.assertEquals(key, key)
pub = ECDSAKey(data=bytes(key))
self.assert_(key.can_sign())
self.assert_(not pub.can_sign())
self.assertEquals(key, pub)
示例3: test_16_compare_ecdsa_384
# 需要导入模块: from paramiko import ECDSAKey [as 别名]
# 或者: from paramiko.ECDSAKey import can_sign [as 别名]
def test_16_compare_ecdsa_384(self):
# verify that the private & public keys compare equal
key = ECDSAKey.from_private_key_file(_support("test_ecdsa_384.key"))
self.assertEqual(key, key)
pub = ECDSAKey(data=key.asbytes())
self.assertTrue(key.can_sign())
self.assertTrue(not pub.can_sign())
self.assertEqual(key, pub)