summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/__init__.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2014-10-08 19:28:33 -0500
committerRuben Pollan <meskio@sindominio.net>2014-10-09 10:22:08 -0500
commit13eafd0ad9a34581f37f5c0adde4ab59d13f0b85 (patch)
tree0918cb5bc1d35170ea57685ecd7ee45af4248297 /src/leap/keymanager/__init__.py
parent613e59c5a34e99e669e727caff00e1516369e3d0 (diff)
Accept ascii keys on put_key
Diffstat (limited to 'src/leap/keymanager/__init__.py')
-rw-r--r--src/leap/keymanager/__init__.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/leap/keymanager/__init__.py b/src/leap/keymanager/__init__.py
index bd85c2d4..da679acb 100644
--- a/src/leap/keymanager/__init__.py
+++ b/src/leap/keymanager/__init__.py
@@ -515,11 +515,14 @@ class KeyManager(object):
"""
Put C{key} in local storage.
- :param key: The key to be stored.
- :type key: OpenPGPKey
+ :param key: The key to be stored. It can be ascii key or an OpenPGPKey
+ :type key: str or OpenPGPKey
"""
try:
- self._wrapper_map[type(key)].put_key(key)
+ if isinstance(key, basestring):
+ self._wrapper_map[OpenPGPKey].put_ascii_key(key)
+ else:
+ self._wrapper_map[type(key)].put_key(key)
except IndexError as e:
leap_assert(False, "Unsupported key type. Error {0!r}".format(e))