aboutsummaryrefslogtreecommitdiff
path: root/python/tests/pk_test.py
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2019-04-12 19:21:17 -0400
committerGitHub <noreply@github.com>2019-04-12 19:21:17 -0400
commit0d0169c839d7c7956c300d36b1757a174b059c44 (patch)
treed2fb957b6059c604e73acdc1fe48a989c0c87e39 /python/tests/pk_test.py
parentb12fe0aeb3cbee8c4067a4fd229a7fb54de6781b (diff)
parentab6e8d5086894ae73c33b124a0c04df4b0195a46 (diff)
Merge pull request #86 from matrix-org/add_python_pk_signing
add python bindings for PK signing
Diffstat (limited to 'python/tests/pk_test.py')
-rw-r--r--python/tests/pk_test.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/python/tests/pk_test.py b/python/tests/pk_test.py
index f2aa147..fe3b4b6 100644
--- a/python/tests/pk_test.py
+++ b/python/tests/pk_test.py
@@ -1,6 +1,7 @@
import pytest
-from olm import PkDecryption, PkDecryptionError, PkEncryption
+from olm import (PkDecryption, PkDecryptionError, PkEncryption, PkSigning,
+ ed25519_verify)
class TestClass(object):
@@ -47,3 +48,10 @@ class TestClass(object):
with pytest.raises(PkDecryptionError):
PkDecryption.from_pickle(pickle, "Not secret")
+
+ def test_signing(self):
+ seed = PkSigning.generate_seed()
+ signing = PkSigning(seed)
+ message = "This statement is true"
+ signature = signing.sign(message)
+ ed25519_verify(signing.public_key, message, signature)