diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/profile')
12 files changed, 64 insertions, 100 deletions
diff --git a/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java index 7f624cb8b..696d0cd13 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java @@ -550,12 +550,6 @@ public abstract class BasicProfile implements IProfile { throws EProfileException { IConfigStore outputStore = mConfig.getSubStore("output"); - String output_list = null; - - try { - output_list = outputStore.getString(PROP_OUTPUT_LIST, ""); - } catch (Exception ee) { - } IPluginInfo outputInfo = mRegistry.getPluginInfo("profileOutput", outputId); @@ -650,13 +644,6 @@ public abstract class BasicProfile implements IProfile { throws EProfileException { IConfigStore inputStore = mConfig.getSubStore("input"); - String input_list = null; - - try { - input_list = inputStore.getString(PROP_INPUT_LIST, ""); - } catch (Exception ee) { - } - IPluginInfo inputInfo = mRegistry.getPluginInfo("profileInput", inputId); @@ -856,14 +843,6 @@ public abstract class BasicProfile implements IProfile { CMS.debug("WARNING, can't get default plugin id!"); } - String constraintRoot = curId + "." + PROP_CONSTRAINT; - String curConstraintClassId = null; - try { - curConstraintClassId = pStore.getString(constraintRoot + "." + PROP_CLASS_ID); - } catch (Exception e) { - CMS.debug("WARNING, can't get constraint plugin id!"); - } - //Disallow duplicate defaults with the following exceptions: // noDefaultImpl, genericExtDefaultImpl diff --git a/pki/base/common/src/com/netscape/cms/profile/common/CACertCAEnrollProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/CACertCAEnrollProfile.java index 3ad301b26..b95b22339 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/CACertCAEnrollProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/CACertCAEnrollProfile.java @@ -49,8 +49,7 @@ public class CACertCAEnrollProfile extends CAEnrollProfile createProfileOutput("o1", "certOutputImpl", outputParams1); // create policies - IProfilePolicy policy1 = - createProfilePolicy("set1", "p1", + createProfilePolicy("set1", "p1", "userSubjectNameDefaultImpl", "noConstraintImpl"); IProfilePolicy policy2 = diff --git a/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java index f2e921a53..d574f0f94 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java @@ -379,7 +379,6 @@ public abstract class EnrollProfile extends BasicProfile org.mozilla.jss.pkix.cms.SignedData cmcFullReq = (org.mozilla.jss.pkix.cms.SignedData) cmcReq.getInterpretedContent(); org.mozilla.jss.pkix.cms.EncapsulatedContentInfo ci = cmcFullReq.getContentInfo(); - OBJECT_IDENTIFIER id = ci.getContentType(); OCTET_STRING content = ci.getContent(); ByteArrayInputStream s = new ByteArrayInputStream(content.toByteArray()); @@ -1158,7 +1157,9 @@ public abstract class EnrollProfile extends BasicProfile /* get SPKAC Algorithm & Signature */ DerValue derSPKACContent[] = derIn.getSequence(3); + @SuppressWarnings("unused") AlgorithmId mAlgId = AlgorithmId.parse(derSPKACContent[1]); + @SuppressWarnings("unused") byte mSignature[] = derSPKACContent[2].getBitString(); /* get PKAC SPKI & Challenge */ @@ -1167,9 +1168,11 @@ public abstract class EnrollProfile extends BasicProfile derIn = new DerInputStream(mPKAC); DerValue derPKACContent[] = derIn.getSequence(2); + @SuppressWarnings("unused") DerValue mDerSPKI = derPKACContent[0]; X509Key mSPKI = X509Key.parse(derPKACContent[0]); + @SuppressWarnings("unused") String mChallenge; DerValue mDerChallenge = derPKACContent[1]; diff --git a/pki/base/common/src/com/netscape/cms/profile/constraint/KeyConstraint.java b/pki/base/common/src/com/netscape/cms/profile/constraint/KeyConstraint.java index 558338e7f..e6f5019a0 100644 --- a/pki/base/common/src/com/netscape/cms/profile/constraint/KeyConstraint.java +++ b/pki/base/common/src/com/netscape/cms/profile/constraint/KeyConstraint.java @@ -72,285 +72,285 @@ public class KeyConstraint extends EnrollConstraint { "sect131r1", "sect131r2" }; - private final static HashMap<String, Vector> ecOIDs = new HashMap<String, Vector>(); + private final static HashMap<String, Vector<String>> ecOIDs = new HashMap<String, Vector<String>>(); static { - ecOIDs.put("1.2.840.10045.3.1.7", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.7", new Vector<String>() { { add("nistp256"); add("secp256r1"); } }); - ecOIDs.put("1.3.132.0.34", new Vector() { + ecOIDs.put("1.3.132.0.34", new Vector<String>() { { add("nistp384"); add("secp384r1"); } }); - ecOIDs.put("1.3.132.0.35", new Vector() { + ecOIDs.put("1.3.132.0.35", new Vector<String>() { { add("nistp521"); add("secp521r1"); } }); - ecOIDs.put("1.3.132.0.1", new Vector() { + ecOIDs.put("1.3.132.0.1", new Vector<String>() { { add("sect163k1"); add("nistk163"); } }); - ecOIDs.put("1.3.132.0.2", new Vector() { + ecOIDs.put("1.3.132.0.2", new Vector<String>() { { add("sect163r1"); } }); - ecOIDs.put("1.3.132.0.15", new Vector() { + ecOIDs.put("1.3.132.0.15", new Vector<String>() { { add("sect163r2"); add("nistb163"); } }); - ecOIDs.put("1.3.132.0.24", new Vector() { + ecOIDs.put("1.3.132.0.24", new Vector<String>() { { add("sect193r1"); } }); - ecOIDs.put("1.3.132.0.25", new Vector() { + ecOIDs.put("1.3.132.0.25", new Vector<String>() { { add("sect193r2"); } }); - ecOIDs.put("1.3.132.0.26", new Vector() { + ecOIDs.put("1.3.132.0.26", new Vector<String>() { { add("sect233k1"); add("nistk233"); } }); - ecOIDs.put("1.3.132.0.27", new Vector() { + ecOIDs.put("1.3.132.0.27", new Vector<String>() { { add("sect233r1"); add("nistb233"); } }); - ecOIDs.put("1.3.132.0.3", new Vector() { + ecOIDs.put("1.3.132.0.3", new Vector<String>() { { add("sect239k1"); } }); - ecOIDs.put("1.3.132.0.16", new Vector() { + ecOIDs.put("1.3.132.0.16", new Vector<String>() { { add("sect283k1"); add("nistk283"); } }); - ecOIDs.put("1.3.132.0.17", new Vector() { + ecOIDs.put("1.3.132.0.17", new Vector<String>() { { add("sect283r1"); add("nistb283"); } }); - ecOIDs.put("1.3.132.0.36", new Vector() { + ecOIDs.put("1.3.132.0.36", new Vector<String>() { { add("sect409k1"); add("nistk409"); } }); - ecOIDs.put("1.3.132.0.37", new Vector() { + ecOIDs.put("1.3.132.0.37", new Vector<String>() { { add("sect409r1"); add("nistb409"); } }); - ecOIDs.put("1.3.132.0.38", new Vector() { + ecOIDs.put("1.3.132.0.38", new Vector<String>() { { add("sect571k1"); add("nistk571"); } }); - ecOIDs.put("1.3.132.0.39", new Vector() { + ecOIDs.put("1.3.132.0.39", new Vector<String>() { { add("sect571r1"); add("nistb571"); } }); - ecOIDs.put("1.3.132.0.9", new Vector() { + ecOIDs.put("1.3.132.0.9", new Vector<String>() { { add("secp160k1"); } }); - ecOIDs.put("1.3.132.0.8", new Vector() { + ecOIDs.put("1.3.132.0.8", new Vector<String>() { { add("secp160r1"); } }); - ecOIDs.put("1.3.132.0.30", new Vector() { + ecOIDs.put("1.3.132.0.30", new Vector<String>() { { add("secp160r2"); } }); - ecOIDs.put("1.3.132.0.31", new Vector() { + ecOIDs.put("1.3.132.0.31", new Vector<String>() { { add("secp192k1"); } }); - ecOIDs.put("1.2.840.10045.3.1.1", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.1", new Vector<String>() { { add("secp192r1"); add("nistp192"); add("prime192v1"); } }); - ecOIDs.put("1.3.132.0.32", new Vector() { + ecOIDs.put("1.3.132.0.32", new Vector<String>() { { add("secp224k1"); } }); - ecOIDs.put("1.3.132.0.33", new Vector() { + ecOIDs.put("1.3.132.0.33", new Vector<String>() { { add("secp224r1"); add("nistp224"); } }); - ecOIDs.put("1.3.132.0.10", new Vector() { + ecOIDs.put("1.3.132.0.10", new Vector<String>() { { add("secp256k1"); } }); - ecOIDs.put("1.2.840.10045.3.1.2", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.2", new Vector<String>() { { add("prime192v2"); } }); - ecOIDs.put("1.2.840.10045.3.1.3", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.3", new Vector<String>() { { add("prime192v3"); } }); - ecOIDs.put("1.2.840.10045.3.1.4", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.4", new Vector<String>() { { add("prime239v1"); } }); - ecOIDs.put("1.2.840.10045.3.1.5", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.5", new Vector<String>() { { add("prime239v2"); } }); - ecOIDs.put("1.2.840.10045.3.1.6", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.6", new Vector<String>() { { add("prime239v3"); } }); - ecOIDs.put("1.2.840.10045.3.0.1", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.1", new Vector<String>() { { add("c2pnb163v1"); } }); - ecOIDs.put("1.2.840.10045.3.0.2", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.2", new Vector<String>() { { add("c2pnb163v2"); } }); - ecOIDs.put("1.2.840.10045.3.0.3", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.3", new Vector<String>() { { add("c2pnb163v3"); } }); - ecOIDs.put("1.2.840.10045.3.0.4", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.4", new Vector<String>() { { add("c2pnb176v1"); } }); - ecOIDs.put("1.2.840.10045.3.0.5", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.5", new Vector<String>() { { add("c2tnb191v1"); } }); - ecOIDs.put("1.2.840.10045.3.0.6", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.6", new Vector<String>() { { add("c2tnb191v2"); } }); - ecOIDs.put("1.2.840.10045.3.0.7", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.7", new Vector<String>() { { add("c2tnb191v3"); } }); - ecOIDs.put("1.2.840.10045.3.0.10", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.10", new Vector<String>() { { add("c2pnb208w1"); } }); - ecOIDs.put("1.2.840.10045.3.0.11", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.11", new Vector<String>() { { add("c2tnb239v1"); } }); - ecOIDs.put("1.2.840.10045.3.0.12", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.12", new Vector<String>() { { add("c2tnb239v2"); } }); - ecOIDs.put("1.2.840.10045.3.0.13", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.13", new Vector<String>() { { add("c2tnb239v3"); } }); - ecOIDs.put("1.2.840.10045.3.0.16", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.16", new Vector<String>() { { add("c2pnb272w1"); } }); - ecOIDs.put("1.2.840.10045.3.0.17", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.17", new Vector<String>() { { add("c2pnb304w1"); } }); - ecOIDs.put("1.2.840.10045.3.0.19", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.19", new Vector<String>() { { add("c2pnb368w1"); } }); - ecOIDs.put("1.2.840.10045.3.0.20", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.20", new Vector<String>() { { add("c2tnb431r1"); } }); - ecOIDs.put("1.3.132.0.6", new Vector() { + ecOIDs.put("1.3.132.0.6", new Vector<String>() { { add("secp112r1"); } }); - ecOIDs.put("1.3.132.0.7", new Vector() { + ecOIDs.put("1.3.132.0.7", new Vector<String>() { { add("secp112r2"); } }); - ecOIDs.put("1.3.132.0.28", new Vector() { + ecOIDs.put("1.3.132.0.28", new Vector<String>() { { add("secp128r1"); } }); - ecOIDs.put("1.3.132.0.29", new Vector() { + ecOIDs.put("1.3.132.0.29", new Vector<String>() { { add("secp128r2"); } }); - ecOIDs.put("1.3.132.0.4", new Vector() { + ecOIDs.put("1.3.132.0.4", new Vector<String>() { { add("sect113r1"); } }); - ecOIDs.put("1.3.132.0.5", new Vector() { + ecOIDs.put("1.3.132.0.5", new Vector<String>() { { add("sect113r2"); } }); - ecOIDs.put("1.3.132.0.22", new Vector() { + ecOIDs.put("1.3.132.0.22", new Vector<String>() { { add("sect131r1"); } }); - ecOIDs.put("1.3.132.0.23", new Vector() { + ecOIDs.put("1.3.132.0.23", new Vector<String>() { { add("sect131r2"); } @@ -422,7 +422,6 @@ public class KeyConstraint extends EnrollConstraint { } int keySize = 0; - String ecCurve = ""; if (alg.equals("RSA")) { keySize = getRSAKeyLen(key); @@ -468,7 +467,7 @@ public class KeyConstraint extends EnrollConstraint { } CMS.debug("EC key OID: " + params); - Vector vect = ecOIDs.get(params); + Vector<String> vect = ecOIDs.get(params); boolean curveFound = false; diff --git a/pki/base/common/src/com/netscape/cms/profile/constraint/SigningAlgConstraint.java b/pki/base/common/src/com/netscape/cms/profile/constraint/SigningAlgConstraint.java index 2125bb81e..4dbe329b3 100644 --- a/pki/base/common/src/com/netscape/cms/profile/constraint/SigningAlgConstraint.java +++ b/pki/base/common/src/com/netscape/cms/profile/constraint/SigningAlgConstraint.java @@ -117,7 +117,7 @@ public class SigningAlgConstraint extends EnrollConstraint { AlgorithmId id = (AlgorithmId) algId.get(CertificateAlgorithmId.ALGORITHM); - Vector mCache = new Vector(); + Vector<String> mCache = new Vector<String>(); StringTokenizer st = new StringTokenizer( getConfig(CONFIG_ALGORITHMS_ALLOWED), ","); diff --git a/pki/base/common/src/com/netscape/cms/profile/def/AuthInfoAccessExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/AuthInfoAccessExtDefault.java index 76ea4e143..4e4f951f7 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/AuthInfoAccessExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/AuthInfoAccessExtDefault.java @@ -340,7 +340,7 @@ public class AuthInfoAccessExtDefault extends EnrollExtDefault { int num = getNumAds(); CMS.debug("AuthInfoAccess num=" + num); - Vector recs = new Vector(); + Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); for (int i = 0; i < num; i++) { NameValuePairs np = new NameValuePairs(); @@ -375,7 +375,6 @@ public class AuthInfoAccessExtDefault extends EnrollExtDefault { public String getText(Locale locale) { StringBuffer ads = new StringBuffer(); - String numAds = getConfig(CONFIG_NUM_ADS); int num = getNumAds(); for (int i = 0; i < num; i++) { 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 c7a0f9abd..d1def3d5d 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 @@ -434,8 +434,6 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault { if (ext == null) return ""; - StringBuffer sb = new StringBuffer(); - Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); int num = getNumPoints(); @@ -497,7 +495,6 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault { if (gn != null) { hasFullName = true; - int type = gn.getType(); pairs.put(POINT_TYPE, getGeneralNameType(gn)); pairs.put(POINT_NAME, getGeneralNameValue(gn)); @@ -528,7 +525,6 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault { if (gn != null) { hasFullName = true; - int type = gn.getType(); pairs.put(ISSUER_TYPE, getGeneralNameType(gn)); pairs.put(ISSUER_NAME, getGeneralNameValue(gn)); diff --git a/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java index 5310986d5..67ebadbe4 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java @@ -396,7 +396,6 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe int pos = name.indexOf(':'); if (pos == -1) return false; - String nameType = name.substring(0, pos).trim(); String nameValue = name.substring(pos + 1).trim(); if (nameValue.equals("")) return false; @@ -480,7 +479,7 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe if (nameType.equalsIgnoreCase("OIDName")) { try { // check if OID - ObjectIdentifier oid = new ObjectIdentifier(nameValue); + new ObjectIdentifier(nameValue); } catch (Exception e) { return null; } diff --git a/pki/base/common/src/com/netscape/cms/profile/def/FreshestCRLExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/FreshestCRLExtDefault.java index 739fd3448..acbbd1089 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/FreshestCRLExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/FreshestCRLExtDefault.java @@ -379,8 +379,6 @@ public class FreshestCRLExtDefault extends EnrollExtDefault { if (ext == null) return ""; - StringBuffer sb = new StringBuffer(); - Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); int num = getNumPoints(); for (int i = 0; i < num; i++) { @@ -431,7 +429,6 @@ public class FreshestCRLExtDefault extends EnrollExtDefault { if (gn != null) { hasFullName = true; - int type = gn.getType(); pairs.put(POINT_TYPE, getGeneralNameType(gn)); pairs.put(POINT_NAME, getGeneralNameValue(gn)); @@ -453,7 +450,6 @@ public class FreshestCRLExtDefault extends EnrollExtDefault { if (gn != null) { hasFullName = true; - int type = gn.getType(); pairs.put(ISSUER_TYPE, getGeneralNameType(gn)); pairs.put(ISSUER_NAME, getGeneralNameValue(gn)); diff --git a/pki/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java index 1f05fef3e..712641c0d 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java @@ -310,9 +310,6 @@ public class PolicyMappingsExtDefault extends EnrollExtDefault { Enumeration<CertificatePolicyMap> maps = ext.getMappings(); - int num = 0; - StringBuffer sb = new StringBuffer(); - Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); for (int i = 0; i < num_mappings; i++) { @@ -346,7 +343,6 @@ public class PolicyMappingsExtDefault extends EnrollExtDefault { public String getText(Locale locale) { StringBuffer sb = new StringBuffer(); - String numMappings = getConfig(CONFIG_NUM_POLICY_MAPPINGS); int num = getNumMappings(); for (int i = 0; i < num; i++) { diff --git a/pki/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java index b205f7df4..d3838577e 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java @@ -382,7 +382,6 @@ public class SubjectAltNameExtDefault extends EnrollExtDefault { */ public String getText(Locale locale) { StringBuffer sb = new StringBuffer(); - String numGNs = getConfig(CONFIG_NUM_GNS); int num = getNumGNs(); for (int i = 0; i < num; i++) { diff --git a/pki/base/common/src/com/netscape/cms/profile/def/SubjectInfoAccessExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/SubjectInfoAccessExtDefault.java index 104b29a08..8ea7533cc 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/SubjectInfoAccessExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/SubjectInfoAccessExtDefault.java @@ -335,7 +335,7 @@ public class SubjectInfoAccessExtDefault extends EnrollExtDefault { int num = getNumAds(); CMS.debug("SubjectInfoAccess num=" + num); - Vector recs = new Vector(); + Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); for (int i = 0; i < num; i++) { NameValuePairs np = new NameValuePairs(); @@ -370,7 +370,6 @@ public class SubjectInfoAccessExtDefault extends EnrollExtDefault { public String getText(Locale locale) { StringBuffer ads = new StringBuffer(); - String numAds = getConfig(CONFIG_NUM_ADS); int num = getNumAds(); for (int i = 0; i < num; i++) { |