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