From b5cfe1746ca36861a0bf8039681f27275b9b9e59 Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Wed, 5 Feb 2014 10:26:10 -0500 Subject: Add strength and algorithm to KeyData and KeyInfo classes Make sure these are updated so that clients can get this information when accessing a symmetric key. Also allow a default for generation requests (but not for archival requests). --- .../src/com/netscape/cms/servlet/test/DRMTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'base/kra') diff --git a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java index 05995f614..42ab77c90 100644 --- a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java +++ b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java @@ -269,6 +269,7 @@ public class DRMTest { log("Getting key ID for symmetric key"); keyInfo = client.getKeyData(clientId, "active"); + printKeyInfo(keyInfo); KeyId keyId2 = keyInfo.getKeyId(); if (keyId2 == null) { log("No archived key found"); @@ -378,6 +379,7 @@ public class DRMTest { //Test 13: Get keyId for active passphrase with client ID log("Getting key ID for passphrase"); keyInfo = client.getKeyData(clientId, "active"); + printKeyInfo(keyInfo); keyId2 = keyInfo.getKeyId(); if (keyId2 == null) { log("No archived key found"); @@ -572,6 +574,7 @@ public class DRMTest { // test 29: Get keyId for active key with client ID log("Getting key ID for symmetric key"); keyInfo = client.getKeyData(clientId, "active"); + printKeyInfo(keyInfo); keyId2 = keyInfo.getKeyId(); if (keyId2 == null) { log("No archived key found"); @@ -661,6 +664,7 @@ public class DRMTest { //Test 37: Get keyId for active key with client ID log("Getting key ID for symmetric key"); keyInfo = client.getKeyData(clientId, "active"); + printKeyInfo(keyInfo); keyId2 = keyInfo.getKeyId(); if (keyId2 == null) { log("No archived key found"); @@ -713,8 +717,15 @@ public class DRMTest { } + private static void printKeyInfo(KeyInfo keyInfo) { + log("Printing keyInfo:"); + log("ClientID: " + keyInfo.getClientID()); + log("Key URL: " + keyInfo.getKeyURL()); + log("Algorithm: " + keyInfo.getAlgorithm()); + log("Strength: " + keyInfo.getStrength()); + } + private static void log(String string) { - // TODO Auto-generated method stub System.out.println(string); } -- cgit