コード例 #1
0
ファイル: session_test.py プロジェクト: Bubu/olm-mirror
 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