summaryrefslogtreecommitdiffstats
path: root/base/kra/functional/drmtest.py
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-02-24 15:31:12 -0500
committerAde Lee <alee@redhat.com>2014-02-26 01:18:56 -0500
commit62d4b2b3934507b1ddf699bcea4a6295565bb008 (patch)
tree624b07de5aa7dc1b824f4094f3b3a1fb4fab2320 /base/kra/functional/drmtest.py
parent4488bb70e2b762d5282fcf88f1c4a349300dd6ea (diff)
downloadpki-62d4b2b3934507b1ddf699bcea4a6295565bb008.tar.gz
pki-62d4b2b3934507b1ddf699bcea4a6295565bb008.tar.xz
pki-62d4b2b3934507b1ddf699bcea4a6295565bb008.zip
Add ability to archive without sending pkiArchiveOptions object.
With this patch, you can now either send a pkiArchiveOptions object or the exploded parameters. This reduces the processing required on the client side.
Diffstat (limited to 'base/kra/functional/drmtest.py')
-rw-r--r--base/kra/functional/drmtest.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/base/kra/functional/drmtest.py b/base/kra/functional/drmtest.py
index dd7abbf53..08baf5011 100644
--- a/base/kra/functional/drmtest.py
+++ b/base/kra/functional/drmtest.py
@@ -106,7 +106,7 @@ def main():
# Test 4: generate symkey -- same as barbican_encode()
print "Now generating symkey on KRA"
#client_key_id = "Vek #1" + time.strftime('%X %x %Z')
- client_key_id = "veka6"
+ client_key_id = "veka9"
algorithm = "AES"
key_size = 128
usages = [key.SymKeyGenerationRequest.DECRYPT_USAGE, key.SymKeyGenerationRequest.ENCRYPT_USAGE]
@@ -132,6 +132,7 @@ def main():
# Test 6: Barbican_decode() - Retrieve while providing trans_wrapped_session_key
session_key = crypto.generate_session_key()
wrapped_session_key = crypto.asymmetric_wrap(session_key, keyclient.transport_cert)
+ print "My key id is " + str(key_id)
key_data, _unwrapped_key = keyclient.retrieve_key(key_id, trans_wrapped_session_key=wrapped_session_key)
print_key_data(key_data)
unwrapped_key = crypto.symmetric_unwrap(base64.decodestring(key_data.wrappedPrivateData),
@@ -211,5 +212,17 @@ def main():
response = keyclient.generate_symmetric_key(client_key_id)
print_key_request(response.requestInfo)
+ # Test 19: Try to archive key
+ print "try to archive key"
+ print "key to archive: " + key1
+ client_key_id = "Vek #4" + time.strftime('%X %x %Z')
+
+ # this test is not quite working yet
+ #response = keyclient.archive_key(client_key_id, keyclient.SYMMETRIC_KEY_TYPE,
+ # private_data=base64.decodestring(key1),
+ # key_algorithm=keyclient.AES_ALGORITHM,
+ # key_size=128)
+ #print_key_request(response.requestInfo)
+
if __name__ == "__main__":
main()