Exemplo n.º 1
0
    def test_serialize_response(self):
        key = rsa.RSAPrivateKey(rsa_test.private_key)
        signature = key.sign(SERIALIZED_CHALLENGE)
        response = msgpack_protocol.Response(challenge=SERIALIZED_CHALLENGE,
                                             signature=signature)

        self.assertEqual(SERIALIZED_RESPONSE, response.serialize())
Exemplo n.º 2
0
 def __init__(self, priv_key):
     self.key = rsa.RSAPrivateKey(priv_key)
Exemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     TestCase.__init__(self, *args, **kwargs)
     self.private_key = rsa.RSAPrivateKey(private_key)
     self.public_key = rsa.RSAPublicKey(public_key)