summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/key
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-02-10 11:20:25 -0500
committerAde Lee <alee@redhat.com>2014-02-10 11:23:37 -0500
commit9b92336bb63f7a4376e5a3915fc16026d3e4256a (patch)
tree28e333b85234827dea191e75bf7a3c2404ec0c71 /base/common/src/com/netscape/certsrv/key
parent552953c15e8456b0d5e5a33a65da5553d14e6853 (diff)
downloadpki-9b92336bb63f7a4376e5a3915fc16026d3e4256a.tar.gz
pki-9b92336bb63f7a4376e5a3915fc16026d3e4256a.tar.xz
pki-9b92336bb63f7a4376e5a3915fc16026d3e4256a.zip
Fix minor issues from review.
1. Use size/keySize consistently, instead of strength. 2. Change to using Integer instead of int in SymKeyGenerationRequest. 3. Fix error message.
Diffstat (limited to 'base/common/src/com/netscape/certsrv/key')
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java16
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyData.java14
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyInfo.java10
-rw-r--r--base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java8
4 files changed, 24 insertions, 24 deletions
diff --git a/base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java b/base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java
index bb25974e9..ba87e1b8b 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java
@@ -40,7 +40,7 @@ public class KeyArchivalRequest extends ResourceMessage {
private static final String DATA_TYPE = "dataType";
private static final String WRAPPED_PRIVATE_DATA = "wrappedPrivateData";
private static final String KEY_ALGORITHM = "keyAlgorithm";
- private static final String KEY_STRENGTH = "keyStrength";
+ private static final String KEY_SIZE = "keySize";
public KeyArchivalRequest() {
// required for JAXB (defaults)
@@ -52,7 +52,7 @@ public class KeyArchivalRequest extends ResourceMessage {
attributes.put(DATA_TYPE, form.getFirst(DATA_TYPE));
attributes.put(WRAPPED_PRIVATE_DATA, form.getFirst(WRAPPED_PRIVATE_DATA));
attributes.put(KEY_ALGORITHM, form.getFirst(KEY_ALGORITHM));
- attributes.put(KEY_STRENGTH, form.getFirst(KEY_STRENGTH));
+ attributes.put(KEY_SIZE, form.getFirst(KEY_SIZE));
setClassName(getClass().getName());
}
@@ -120,15 +120,15 @@ public class KeyArchivalRequest extends ResourceMessage {
/**
* @return the key strength (valid for symmetric keys)
*/
- public int getKeyStrength() {
- return Integer.parseInt(attributes.get(KEY_STRENGTH));
+ public int getKeySize() {
+ return Integer.parseInt(attributes.get(KEY_SIZE));
}
/**
- * @param strength the key strength to set (valid for symmetric keys)
+ * @param keySize the key strength to set (valid for symmetric keys)
*/
- public void setKeyStrength(int strength) {
- attributes.put(KEY_STRENGTH, Integer.toString(strength));
+ public void setKeySize(int keySize) {
+ attributes.put(KEY_SIZE, Integer.toString(keySize));
}
public String toString() {
@@ -154,7 +154,7 @@ public class KeyArchivalRequest extends ResourceMessage {
before.setDataType(KeyRequestResource.SYMMETRIC_KEY_TYPE);
before.setWrappedPrivateData("XXXXABCDEFXXX");
before.setKeyAlgorithm(KeyRequestResource.AES_ALGORITHM);
- before.setKeyStrength(128);
+ before.setKeySize(128);
String string = before.toString();
System.out.println(string);
diff --git a/base/common/src/com/netscape/certsrv/key/KeyData.java b/base/common/src/com/netscape/certsrv/key/KeyData.java
index 82e23ed9e..4fcb6b420 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyData.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyData.java
@@ -46,7 +46,7 @@ public class KeyData {
String algorithm;
@XmlElement
- Integer strength;
+ Integer size;
public KeyData() {
// required for JAXB (defaults)
@@ -111,16 +111,16 @@ public class KeyData {
}
/**
- * @return the strength
+ * @return the size
*/
- public Integer getStrength() {
- return strength;
+ public Integer getSize() {
+ return size;
}
/**
- * @param strength the strength to set
+ * @param size the size to set
*/
- public void setStrength(Integer strength) {
- this.strength = strength;
+ public void setSize(Integer size) {
+ this.size = size;
}
}
diff --git a/base/common/src/com/netscape/certsrv/key/KeyInfo.java b/base/common/src/com/netscape/certsrv/key/KeyInfo.java
index 897fc3b1d..a4f4e62f3 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyInfo.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyInfo.java
@@ -49,7 +49,7 @@ public class KeyInfo {
protected String algorithm;
@XmlElement
- protected Integer strength;
+ protected Integer size;
@XmlElement
protected String ownerName;
@@ -110,12 +110,12 @@ public class KeyInfo {
this.algorithm = algorithm;
}
- public Integer getStrength() {
- return strength;
+ public Integer getSize() {
+ return size;
}
- public void setStrength(Integer strength) {
- this.strength = strength;
+ public void setSize(Integer size) {
+ this.size = size;
}
public String getOwnerName() {
diff --git a/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java b/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
index c0445e455..7510b8c78 100644
--- a/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
+++ b/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
@@ -95,15 +95,15 @@ public class SymKeyGenerationRequest extends ResourceMessage {
/**
* @return the keySize
*/
- public int getKeySize() {
- return Integer.parseInt(attributes.get(KEY_SIZE));
+ public Integer getKeySize() {
+ return new Integer(attributes.get(KEY_SIZE));
}
/**
* @param keySize the key size to set
*/
- public void setKeySize(int keySize) {
- attributes.put(KEY_SIZE, Integer.toString(keySize));
+ public void setKeySize(Integer keySize) {
+ attributes.put(KEY_SIZE, keySize.toString());
}
/**