summaryrefslogtreecommitdiffstats
path: root/base/kra/functional
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-03-04 14:19:22 -0500
committerAde Lee <alee@redhat.com>2014-03-05 12:07:24 -0500
commit2adf17fbcd106bbf09513a30bd320505afc85c01 (patch)
treeb891e3435766c11d5aa39c3eabcb824d4c4c9a02 /base/kra/functional
parent316e66bf974eaaa576336e45670b6aaf90ba476c (diff)
downloadpki-2adf17fbcd106bbf09513a30bd320505afc85c01.tar.gz
pki-2adf17fbcd106bbf09513a30bd320505afc85c01.tar.xz
pki-2adf17fbcd106bbf09513a30bd320505afc85c01.zip
Get archival working for python key client
Diffstat (limited to 'base/kra/functional')
-rw-r--r--base/kra/functional/drmtest.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/base/kra/functional/drmtest.py b/base/kra/functional/drmtest.py
index 169a7879f..00f7d7a9d 100644
--- a/base/kra/functional/drmtest.py
+++ b/base/kra/functional/drmtest.py
@@ -216,12 +216,24 @@ def main():
print "key to archive: " + key1
client_key_id = "Vek #4" + time.strftime('%c')
- # this test is not quite working yet
- #response = keyclient.archive_key(client_key_id, keyclient.SYMMETRIC_KEY_TYPE,
- # base64.decodestring(key1),
- # key_algorithm=keyclient.AES_ALGORITHM,
- # key_size=128)
- #print_key_request(response.requestInfo)
+ response = keyclient.archive_key(client_key_id, keyclient.SYMMETRIC_KEY_TYPE,
+ base64.decodestring(key1),
+ key_algorithm=keyclient.AES_ALGORITHM,
+ key_size=128)
+ print_key_request(response.requestInfo)
+
+ # Test 20: Lets get it back
+ key_info = keyclient.get_active_key_info(client_key_id)
+ print_key_info(key_info)
+
+ key_data, unwrapped_key = keyclient.retrieve_key(key_info.get_key_id())
+ print_key_data(key_data)
+ key2 = base64.encodestring(unwrapped_key)
+
+ if key1 == key2:
+ print "Success: archived and recovered keys match"
+ else:
+ print "Error: archived and recovered keys do not match"
if __name__ == "__main__":
main()