예제 #1
0
 def _create_session(self):
     alice = Account()
     bob = Account()
     bob.generate_one_time_keys(1)
     id_key = bob.identity_keys["curve25519"]
     one_time = list(bob.one_time_keys["curve25519"].values())[0]
     session = OutboundSession(alice, id_key, one_time)
     return alice, bob, session
예제 #2
0
    def test_publish_one_time_keys(self):
        alice = Account()
        alice.generate_one_time_keys(10)
        one_time_keys = alice.one_time_keys

        assert one_time_keys
        assert len(one_time_keys["curve25519"]) == 10

        alice.mark_keys_as_published()
        assert not alice.one_time_keys["curve25519"]
예제 #3
0
 def test_one_time_keys(self):
     alice = Account()
     alice.generate_one_time_keys(10)
     one_time_keys = alice.one_time_keys
     assert one_time_keys
     assert len(one_time_keys["curve25519"]) == 10