本文整理匯總了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)