summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java')
-rw-r--r--pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java60
1 files changed, 29 insertions, 31 deletions
diff --git a/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java
index a95ec6b7d..c7a0f9abd 100644
--- a/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java
+++ b/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java
@@ -247,8 +247,7 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault {
int i = 0;
for (; i < size; i++) {
- NameValuePairs nvps = (NameValuePairs) v.elementAt(i);
- Enumeration<String> names = nvps.getNames();
+ NameValuePairs nvps = v.elementAt(i);
String pointType = null;
String pointValue = null;
String issuerType = null;
@@ -256,21 +255,20 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault {
String enable = null;
CRLDistributionPoint cdp = new CRLDistributionPoint();
- while (names.hasMoreElements()) {
- String name1 = (String) names.nextElement();
+ for (String name1 : nvps.keySet()) {
if (name1.equals(REASONS)) {
- addReasons(locale, cdp, REASONS, nvps.getValue(name1));
+ addReasons(locale, cdp, REASONS, nvps.get(name1));
} else if (name1.equals(POINT_TYPE)) {
- pointType = nvps.getValue(name1);
+ pointType = nvps.get(name1);
} else if (name1.equals(POINT_NAME)) {
- pointValue = nvps.getValue(name1);
+ pointValue = nvps.get(name1);
} else if (name1.equals(ISSUER_TYPE)) {
- issuerType = nvps.getValue(name1);
+ issuerType = nvps.get(name1);
} else if (name1.equals(ISSUER_NAME)) {
- issuerValue = nvps.getValue(name1);
+ issuerValue = nvps.get(name1);
} else if (name1.equals(ENABLE)) {
- enable = nvps.getValue(name1);
+ enable = nvps.get(name1);
}
}
@@ -466,12 +464,12 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault {
protected NameValuePairs buildEmptyGeneralNames() {
NameValuePairs pairs = new NameValuePairs();
- pairs.add(POINT_TYPE, "");
- pairs.add(POINT_NAME, "");
- pairs.add(REASONS, "");
- pairs.add(ISSUER_TYPE, "");
- pairs.add(ISSUER_NAME, "");
- pairs.add(ENABLE, "false");
+ pairs.put(POINT_TYPE, "");
+ pairs.put(POINT_NAME, "");
+ pairs.put(REASONS, "");
+ pairs.put(ISSUER_TYPE, "");
+ pairs.put(ISSUER_NAME, "");
+ pairs.put(ENABLE, "false");
return pairs;
}
@@ -483,16 +481,16 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault {
RDN rdn = null;
boolean hasFullName = false;
- pairs.add(ENABLE, "true");
+ pairs.put(ENABLE, "true");
if (gns == null) {
rdn = p.getRelativeName();
if (rdn != null) {
hasFullName = true;
- pairs.add(POINT_TYPE, RELATIVETOISSUER);
- pairs.add(POINT_NAME, rdn.toString());
+ pairs.put(POINT_TYPE, RELATIVETOISSUER);
+ pairs.put(POINT_NAME, rdn.toString());
} else {
- pairs.add(POINT_TYPE, "");
- pairs.add(POINT_NAME, "");
+ pairs.put(POINT_TYPE, "");
+ pairs.put(POINT_NAME, "");
}
} else {
GeneralName gn = (GeneralName) gns.elementAt(0);
@@ -501,30 +499,30 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault {
hasFullName = true;
int type = gn.getType();
- pairs.add(POINT_TYPE, getGeneralNameType(gn));
- pairs.add(POINT_NAME, getGeneralNameValue(gn));
+ pairs.put(POINT_TYPE, getGeneralNameType(gn));
+ pairs.put(POINT_NAME, getGeneralNameValue(gn));
}
}
if (!hasFullName) {
- pairs.add(POINT_TYPE, GN_DIRECTORY_NAME);
- pairs.add(POINT_NAME, "");
+ pairs.put(POINT_TYPE, GN_DIRECTORY_NAME);
+ pairs.put(POINT_NAME, "");
}
BitArray reasons = p.getReasons();
String s = convertBitArrayToReasonNames(reasons);
if (s.length() > 0) {
- pairs.add(REASONS, s);
+ pairs.put(REASONS, s);
} else {
- pairs.add(REASONS, "");
+ pairs.put(REASONS, "");
}
gns = p.getCRLIssuer();
if (gns == null) {
- pairs.add(ISSUER_TYPE, GN_DIRECTORY_NAME);
- pairs.add(ISSUER_NAME, "");
+ pairs.put(ISSUER_TYPE, GN_DIRECTORY_NAME);
+ pairs.put(ISSUER_NAME, "");
} else {
GeneralName gn = (GeneralName) gns.elementAt(0);
@@ -532,8 +530,8 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault {
hasFullName = true;
int type = gn.getType();
- pairs.add(ISSUER_TYPE, getGeneralNameType(gn));
- pairs.add(ISSUER_NAME, getGeneralNameValue(gn));
+ pairs.put(ISSUER_TYPE, getGeneralNameType(gn));
+ pairs.put(ISSUER_NAME, getGeneralNameValue(gn));
}
}
return pairs;