summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/key
diff options
context:
space:
mode:
Diffstat (limited to 'base/common/src/com/netscape/certsrv/key')
-rw-r--r--base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java b/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
index 01326442f..27dc69fd5 100644
--- a/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
+++ b/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
@@ -25,6 +25,7 @@ public class SymKeyGenerationRequest extends ResourceMessage {
private static final String KEY_SIZE = "keySize";
private static final String KEY_ALGORITHM = "keyAlgorithm";
private static final String KEY_USAGE = "keyUsage";
+ private static final String TRANS_WRAPPED_SESSION_KEY = "transWrappedSessionKey";
/* Symmetric Key usages */
public static final String UWRAP_USAGE = "unwrap";
@@ -65,6 +66,7 @@ public class SymKeyGenerationRequest extends ResourceMessage {
attributes.put(KEY_SIZE, form.getFirst(KEY_SIZE));
attributes.put(KEY_ALGORITHM, form.getFirst(KEY_ALGORITHM));
attributes.put(KEY_USAGE, form.getFirst(KEY_USAGE));
+ attributes.put(TRANS_WRAPPED_SESSION_KEY, form.getFirst(TRANS_WRAPPED_SESSION_KEY));
String usageString = attributes.get(KEY_USAGE);
if (! StringUtils.isBlank(usageString)) {
@@ -96,7 +98,11 @@ public class SymKeyGenerationRequest extends ResourceMessage {
* @return the keySize
*/
public Integer getKeySize() {
- return new Integer(attributes.get(KEY_SIZE));
+ try {
+ return new Integer(attributes.get(KEY_SIZE));
+ } catch (NumberFormatException e) {
+ return null;
+ }
}
/**
@@ -120,6 +126,20 @@ public class SymKeyGenerationRequest extends ResourceMessage {
attributes.put(KEY_ALGORITHM, keyAlgorithm);
}
+ /**
+ * @return the transWrappedSessionKey
+ */
+ public String getTransWrappedSessionKey() {
+ return attributes.get(TRANS_WRAPPED_SESSION_KEY);
+ }
+
+ /**
+ * @param transWrappedSessionKey the wrapped seesion key to set
+ */
+ public void setTransWrappedSessionKey(String transWrappedSessionKey) {
+ attributes.put(TRANS_WRAPPED_SESSION_KEY, transWrappedSessionKey);
+ }
+
public String toString() {
try {
return ResourceMessage.marshal(this, SymKeyGenerationRequest.class);