Esempio n. 1
0
    def test_token_secret_encryption(self):
        secret = generate_shared_secret()
        encrypted_token, encrypted_secret = encrypt_token_and_secret(
            public_key, token, secret)
        decrypted_token = private_key.decrypt(encrypted_token, PKCS1v15())
        decrypted_secret = private_key.decrypt(encrypted_secret, PKCS1v15())

        self.assertEquals(token, decrypted_token)
        self.assertEquals(secret, decrypted_secret)
Esempio n. 2
0
    def test_token_secret_encryption(self):
        secret = generate_shared_secret()
        encrypted_token, encrypted_secret = \
            encrypt_token_and_secret(public_key, token, secret)
        decrypted_token = private_key.decrypt(encrypted_token, PKCS1v15())
        decrypted_secret = private_key.decrypt(encrypted_secret, PKCS1v15())

        self.assertEquals(token, decrypted_token)
        self.assertEquals(secret, decrypted_secret)