本文整理汇总了Python中Crypto.PublicKey.ECC._import_der方法的典型用法代码示例。如果您正苦于以下问题:Python ECC._import_der方法的具体用法?Python ECC._import_der怎么用?Python ECC._import_der使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crypto.PublicKey.ECC
的用法示例。
在下文中一共展示了ECC._import_der方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_import_x509_der
# 需要导入模块: from Crypto.PublicKey import ECC [as 别名]
# 或者: from Crypto.PublicKey.ECC import _import_der [as 别名]
def test_import_x509_der(self):
key_file = load_file("ecc_p521_x509.der")
key = ECC._import_der(key_file, None)
self.assertEqual(self.ref_public, key)
key = ECC.import_key(key_file)
self.assertEqual(self.ref_public, key)
示例2: test_import_private_pkcs8_encrypted_1
# 需要导入模块: from Crypto.PublicKey import ECC [as 别名]
# 或者: from Crypto.PublicKey.ECC import _import_der [as 别名]
def test_import_private_pkcs8_encrypted_1(self):
key_file = load_file("ecc_p521_private_p8.der")
key = ECC._import_der(key_file, "secret")
self.assertEqual(self.ref_private, key)
key = ECC.import_key(key_file, "secret")
self.assertEqual(self.ref_private, key)
示例3: test_import_private_pkcs8_clear
# 需要导入模块: from Crypto.PublicKey import ECC [as 别名]
# 或者: from Crypto.PublicKey.ECC import _import_der [as 别名]
def test_import_private_pkcs8_clear(self):
key_file = load_file("ecc_p521_private_p8_clear.der")
key = ECC._import_der(key_file, None)
self.assertEqual(self.ref_private, key)
key = ECC.import_key(key_file)
self.assertEqual(self.ref_private, key)
示例4: test_import_public_der
# 需要导入模块: from Crypto.PublicKey import ECC [as 别名]
# 或者: from Crypto.PublicKey.ECC import _import_der [as 别名]
def test_import_public_der(self):
key_file = load_file("ecc_p521_public.der")
key = ECC._import_subjectPublicKeyInfo(key_file)
self.assertEqual(self.ref_public, key)
key = ECC._import_der(key_file, None)
self.assertEqual(self.ref_public, key)
key = ECC.import_key(key_file)
self.assertEqual(self.ref_public, key)
示例5: test_import_private_der
# 需要导入模块: from Crypto.PublicKey import ECC [as 别名]
# 或者: from Crypto.PublicKey.ECC import _import_der [as 别名]
def test_import_private_der(self):
key_file = load_file("ecc_p384_private.der")
key = ECC._import_private_der(key_file, None)
self.assertEqual(self.ref_private, key)
key = ECC._import_der(key_file, None)
self.assertEqual(self.ref_private, key)
key = ECC.import_key(key_file)
self.assertEqual(self.ref_private, key)