From 0900a0a7e12064171d60345f448b983e91b56239 Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Thu, 20 Feb 2014 17:26:24 -0500 Subject: Add getActiveKey() to the python client --- base/common/python/pki/key.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'base/common/python/pki') diff --git a/base/common/python/pki/key.py b/base/common/python/pki/key.py index 235825746..ab6db9625 100644 --- a/base/common/python/pki/key.py +++ b/base/common/python/pki/key.py @@ -27,6 +27,7 @@ import pki.encoder as encoder import json import pki import types +import urllib class KeyId(object): ''' @@ -465,6 +466,14 @@ class KeyClient(object): response = self.connection.get(url, headers=self.headers) return KeyInfo.from_json(response.json()) + @pki.handle_exceptions() + def get_active_key_info(self, client_id): + ''' Get the info in the KeyRecord for the active secret in the DRM. ''' + url = self.keyURL + '/active/' + urllib.quote_plus(client_id) + response = self.connection.get(url, headers=self.headers) + print response + return KeyInfo.from_json(response.json()) + @pki.handle_exceptions() def modify_key_status(self, key_id, status): ''' Modify the status of a key ''' -- cgit