summaryrefslogtreecommitdiffstats
path: root/ipapython/secrets/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipapython/secrets/client.py')
-rw-r--r--ipapython/secrets/client.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ipapython/secrets/client.py b/ipapython/secrets/client.py
index 81d066f84..5b671988d 100644
--- a/ipapython/secrets/client.py
+++ b/ipapython/secrets/client.py
@@ -74,7 +74,7 @@ class CustodiaClient(object):
authtok = ctx.step()
return {'Authorization': 'Negotiate %s' % b64encode(authtok)}
- def fetch_key(self, keyname):
+ def fetch_key(self, keyname, store=True):
# Prepare URL
url = 'https://%s/ipa/keys/%s' % (self.server, keyname)
@@ -96,4 +96,8 @@ class CustodiaClient(object):
raise RuntimeError('Invlid JSON response type')
value = self.kemcli.parse_reply(keyname, reply['value'])
- self.keystore.set('keys/%s' % keyname, value)
+
+ if store:
+ self.keystore.set('keys/%s' % keyname, value)
+ else:
+ return value