Esempio n. 1
0
 def test_get_public_key_dsa(self, mock_get_cert):
     fake_cert = FakeCryptoCertificate(TEST_DSA_PRIVATE_KEY.public_key())
     mock_get_cert.return_value = fake_cert
     sig_key_type = signature_utils.SignatureKeyType.lookup('DSA')
     result_pub_key = signature_utils.get_public_key(None, None,
                                                     sig_key_type)
     self.assertEqual(fake_cert.public_key(), result_pub_key)
Esempio n. 2
0
 def test_get_public_key_rsa(self, mock_get_cert):
     fake_cert = FakeCryptoCertificate()
     mock_get_cert.return_value = fake_cert
     sig_key_type = signature_utils.SignatureKeyType.lookup('RSA-PSS')
     result_pub_key = signature_utils.get_public_key(None, None,
                                                     sig_key_type)
     self.assertEqual(fake_cert.public_key(), result_pub_key)
 def test_get_public_key_ecc(self, mock_get_cert):
     fake_cert = FakeCryptoCertificate(TEST_ECC_PRIVATE_KEY.public_key())
     mock_get_cert.return_value = fake_cert
     sig_key_type = signature_utils.SignatureKeyType.lookup('ECC_SECP521R1')
     result_pub_key = signature_utils.get_public_key(
         None, None, sig_key_type)
     self.assertEqual(fake_cert.public_key(), result_pub_key)
Esempio n. 4
0
 def test_get_public_key_rsa(self, mock_get_cert):
     fake_cert = FakeCryptoCertificate()
     mock_get_cert.return_value = fake_cert
     sig_key_type = signature_utils.SignatureKeyType.lookup('RSA-PSS')
     result_pub_key = signature_utils.get_public_key(
         None, None, sig_key_type)
     self.assertEqual(fake_cert.public_key(), result_pub_key)
Esempio n. 5
0
 def test_get_public_key_dsa(self, mock_get_cert):
     fake_cert = FakeCryptoCertificate(TEST_DSA_PRIVATE_KEY.public_key())
     mock_get_cert.return_value = fake_cert
     result_pub_key = signature_utils.get_public_key(None, None, 'DSA')
     self.assertEqual(fake_cert.public_key(), result_pub_key)
Esempio n. 6
0
 def test_get_public_key_rsa(self, mock_get_cert):
     fake_cert = FakeCryptoCertificate()
     mock_get_cert.return_value = fake_cert
     result_pub_key = signature_utils.get_public_key(None, None, 'RSA-PSS')
     self.assertEqual(fake_cert.public_key(), result_pub_key)