Beispiel #1
0
 def setupKeys(self, base_key):
     self.key = base_key
     self.pykey = crypto.PythonRSAKey(
         private_key_string=self.key.get_private_key_string(),
     )
     if crypto.M2CRYPTO_EXISTS:
         self.m2cryptokey = crypto.M2CryptoKey(
             private_key_string=self.key.get_private_key_string(),
             public_key_string=self.key.get_public_key_string()
         )
     if crypto.CRYPTOGRAPHY_EXISTS:
         self.cryptokey = crypto.CryptographyKey(
             private_key_string=self.key.get_private_key_string(),
             public_key_string=self.key.get_public_key_string()
         )
     self.message_actual = "Hello world! Please leave a message after the tone."
     self.message_fake = "Hello world! Please leave a message after the tone..."
Beispiel #2
0
 def setUp(self):
     self.setupKeys(crypto.CryptographyKey())
Beispiel #3
0
 def test_pubkey_verification_crypto(self):
     pubkey = crypto.CryptographyKey(public_key_string=self.key.get_public_key_string())
     sig = self.key.sign(self.message_actual)
     self.assertTrue(pubkey.verify(self.message_actual, sig))
     self.assertFalse(pubkey.verify(self.message_fake, sig))
Beispiel #4
0
 def setUp(self):
     self.key = crypto.CryptographyKey(private_key_string=self.priv_key_string)