diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-27 23:43:07 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-27 23:54:58 +0200 |
commit | 60c13e736b2716ddc252699c2e2f3493b7ee4adf (patch) | |
tree | 050d1cf8c1a39ea0bb782560bd5b52b6cfe7f296 | |
parent | 565b0df1def94bc122245fb3341ca1521b251f04 (diff) | |
download | gemato-60c13e736b2716ddc252699c2e2f3493b7ee4adf.tar.gz |
test_openpgp: Test importing a binary key
-rw-r--r-- | tests/test_openpgp.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_openpgp.py b/tests/test_openpgp.py index 7a48ea4..ef8f14b 100644 --- a/tests/test_openpgp.py +++ b/tests/test_openpgp.py @@ -3,6 +3,7 @@ # (c) 2017 Michał Górny # Licensed under the terms of 2-clause BSD license +import base64 import io import os.path import shutil @@ -498,6 +499,14 @@ class OpenPGPContextManagerTest(unittest.TestCase): except gemato.exceptions.OpenPGPNoImplementation as e: raise unittest.SkipTest(str(e)) + def test_import_binary_key(self): + with gemato.openpgp.OpenPGPEnvironment() as env: + enc = b''.join(PUBLIC_KEY.splitlines()[2:-1]) + try: + env.import_key(io.BytesIO(base64.b64decode(enc))) + except gemato.exceptions.OpenPGPNoImplementation as e: + raise unittest.SkipTest(str(e)) + def test_verify_manifest(self): with io.StringIO(SIGNED_MANIFEST) as f: with gemato.openpgp.OpenPGPEnvironment() as env: |