summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/servlet/csadmin
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/servlet/csadmin')
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java13
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java9
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java12
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/CertUtil.java4
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java22
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java11
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java23
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java20
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java17
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java16
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java6
11 files changed, 88 insertions, 65 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java
index 16c5e6c65..8c84f4a21 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java
@@ -249,12 +249,13 @@ public class AdminAuthenticatePanel extends WizardPanelBase {
c1.append(",preop.ca.hostname,preop.ca.httpport,preop.ca.httpsport,preop.ca.list,preop.ca.pkcs7,preop.ca.type");
}
- String content = "uid="
- + uid
- + "&pwd="
- + pwd
- + "&op=get&names=cloning.module.token,instanceId,internaldb.basedn,internaldb.ldapauth.password,internaldb.replication.password,internaldb.ldapconn.host,internaldb.ldapconn.port,internaldb.ldapauth.bindDN"
- + c1.toString() + "&substores=" + s1.toString();
+ String content =
+ "uid="
+ + uid
+ + "&pwd="
+ + pwd
+ + "&op=get&names=cloning.module.token,instanceId,internaldb.basedn,internaldb.ldapauth.password,internaldb.replication.password,internaldb.ldapconn.host,internaldb.ldapconn.port,internaldb.ldapauth.bindDN"
+ + c1.toString() + "&substores=" + s1.toString();
boolean success = updateConfigEntries(host, httpsport, true,
"/" + cstype + "/admin/" + cstype + "/getConfigEntries", content, config,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java
index d8d841e39..223801d8f 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java
@@ -481,8 +481,10 @@ public class AdminPanel extends WizardPanelBase {
String session_id = CMS.getConfigSDSessionId();
String subjectDN = HttpInput.getString(request, "subject");
- String content = "profileId=" + profileId + "&cert_request_type=" + cert_request_type + "&cert_request="
- + cert_request + "&xmlOutput=true&sessionID=" + session_id + "&subject=" + subjectDN;
+ String content =
+ "profileId="
+ + profileId + "&cert_request_type=" + cert_request_type + "&cert_request=" + cert_request
+ + "&xmlOutput=true&sessionID=" + session_id + "&subject=" + subjectDN;
HttpClient httpclient = new HttpClient();
String c = null;
@@ -651,7 +653,8 @@ public class AdminPanel extends WizardPanelBase {
} catch (Exception e) {
}
if (ca == null && type.equals("otherca")) {
- info = "Since you do not join the Redhat CA network, the administrator's certificate will not be generated automatically.";
+ info =
+ "Since you do not join the Redhat CA network, the administrator's certificate will not be generated automatically.";
}
context.put("info", info);
context.put("admin_email", request.getParameter("email"));
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java
index f73e44c18..c81c666e6 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java
@@ -128,8 +128,8 @@ public class CertRequestPanel extends WizardPanelBase {
if (hardware) {
CMS.debug("CertRequestPanel findCertificate: The certificate with the same nickname: "
+ fullnickname + " has been found on HSM. Please remove it before proceeding.");
- throw new IOException("The certificate with the same nickname: " + fullnickname
- + " has been found on HSM. Please remove it before proceeding.");
+ throw new IOException("The certificate with the same nickname: "
+ + fullnickname + " has been found on HSM. Please remove it before proceeding.");
}
return true;
}
@@ -212,8 +212,8 @@ public class CertRequestPanel extends WizardPanelBase {
CMS.debug("CertRequestPanel cleanup: deleting certificate (" + nickname + ").");
deleteCert(tokenname, nickname);
} catch (Exception e) {
- CMS.debug("CertRequestPanel cleanup: failed to delete certificate (" + nickname + "). Exception: "
- + e.toString());
+ CMS.debug("CertRequestPanel cleanup: failed to delete certificate ("
+ + nickname + "). Exception: " + e.toString());
}
}
}
@@ -735,8 +735,8 @@ public class CertRequestPanel extends WizardPanelBase {
ic.setSSLTrust(InternalCertificate.USER);
ic.setEmailTrust(InternalCertificate.USER);
if (tag.equals("audit_signing")) {
- ic.setObjectSigningTrust(InternalCertificate.USER | InternalCertificate.VALID_PEER
- | InternalCertificate.TRUSTED_PEER);
+ ic.setObjectSigningTrust(InternalCertificate.USER
+ | InternalCertificate.VALID_PEER | InternalCertificate.TRUSTED_PEER);
} else {
ic.setObjectSigningTrust(InternalCertificate.USER);
}
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertUtil.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertUtil.java
index 5e1bd5e80..2934b3ebe 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertUtil.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertUtil.java
@@ -643,8 +643,8 @@ public class CertUtil {
try {
privKey = cm.findPrivKeyByCert(cert);
} catch (Exception e) {
- CMS.debug("CertUtil privateKeyExistsOnToken: cant find private key (" + fullnickname + ") exception: "
- + e.toString());
+ CMS.debug("CertUtil privateKeyExistsOnToken: cant find private key ("
+ + fullnickname + ") exception: " + e.toString());
return false;
}
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java
index bd3a31770..02a992832 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java
@@ -1035,8 +1035,8 @@ public class DatabasePanel extends WizardPanelBase {
// setup replication after indexes have been created
if (select.equals("clone")) {
CMS.debug("Start setting up replication.");
- setupReplication(request, context, (secure.equals("on") ? "true" : "false"),
- (cloneStartTLS.equals("on") ? "true" : "false"));
+ setupReplication(request, context, (secure.equals("on") ? "true" : "false"), (cloneStartTLS.equals("on")
+ ? "true" : "false"));
CMS.debug("Finish setting up replication.");
try {
@@ -1318,8 +1318,8 @@ public class DatabasePanel extends WizardPanelBase {
}
return id;
} else {
- CMS.debug("DatabasePanel enableReplication: Failed to create " + replicadn + " entry. Exception: "
- + e.toString());
+ CMS.debug("DatabasePanel enableReplication: Failed to create "
+ + replicadn + " entry. Exception: " + e.toString());
return id;
}
}
@@ -1378,8 +1378,8 @@ public class DatabasePanel extends WizardPanelBase {
throw ee;
}
} else {
- CMS.debug("DatabasePanel createReplicationAgreement: Failed to create " + dn + " entry. Exception: "
- + e.toString());
+ CMS.debug("DatabasePanel createReplicationAgreement: Failed to create "
+ + dn + " entry. Exception: " + e.toString());
throw e;
}
}
@@ -1391,8 +1391,8 @@ public class DatabasePanel extends WizardPanelBase {
String name) {
String dn = "cn=" + name + "," + replicadn;
CMS.debug("DatabasePanel initializeConsumer: initializeConsumer dn: " + dn);
- CMS.debug("DatabasePanel initializeConsumer: initializeConsumer host: " + conn.getHost() + " port: "
- + conn.getPort());
+ CMS.debug("DatabasePanel initializeConsumer: initializeConsumer host: "
+ + conn.getHost() + " port: " + conn.getPort());
try {
LDAPAttribute attr = new LDAPAttribute("nsds5beginreplicarefresh",
"start");
@@ -1487,9 +1487,9 @@ public class DatabasePanel extends WizardPanelBase {
try {
String filter = "(objectclass=*)";
String[] attrs = { "nsslapd-directory" };
- LDAPSearchResults results = conn.search("cn=config,cn=ldbm database,cn=plugins,cn=config",
- LDAPv3.SCOPE_SUB,
- filter, attrs, false);
+ LDAPSearchResults results =
+ conn.search("cn=config,cn=ldbm database,cn=plugins,cn=config", LDAPv3.SCOPE_SUB,
+ filter, attrs, false);
while (results.hasMoreElements()) {
LDAPEntry entry = results.next();
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java
index c24992cb4..2f5831794 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java
@@ -195,11 +195,14 @@ public class DisplayCertChainPanel extends WizardPanelBase {
String cs_hostname = cs.getString("machineName", "");
int cs_port = cs.getInteger("pkicreate.admin_secure_port", -1);
String subsystem = cs.getString("cs.type", "");
- String urlVal = "https://" + cs_hostname + ":" + cs_port + "/" + toLowerCaseSubsystemType(subsystem)
- + "/admin/console/config/wizard?p=" + panel + "&subsystem=" + subsystem;
+ String urlVal =
+ "https://"
+ + cs_hostname + ":" + cs_port + "/" + toLowerCaseSubsystemType(subsystem)
+ + "/admin/console/config/wizard?p=" + panel + "&subsystem=" + subsystem;
String encodedValue = URLEncoder.encode(urlVal, "UTF-8");
- String sdurl = "https://" + sd_hostname + ":" + sd_port + "/ca/admin/ca/securityDomainLogin?url="
- + encodedValue;
+ String sdurl =
+ "https://"
+ + sd_hostname + ":" + sd_port + "/ca/admin/ca/securityDomainLogin?url=" + encodedValue;
response.sendRedirect(sdurl);
// The user previously specified the CA Security Domain's
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java
index 388570531..ffadf5884 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java
@@ -495,14 +495,14 @@ public class DonePanel extends WizardPanelBase {
} else {
serialdn = "ou=keyRepository,ou=" + type.toLowerCase() + "," + basedn;
}
- LDAPAttribute attrSerialNextRange = new LDAPAttribute("nextRange", endSerialNum.add(oneNum)
- .toString());
+ LDAPAttribute attrSerialNextRange =
+ new LDAPAttribute("nextRange", endSerialNum.add(oneNum).toString());
LDAPModification serialmod = new LDAPModification(LDAPModification.REPLACE, attrSerialNextRange);
conn.modify(serialdn, serialmod);
String requestdn = "ou=" + type.toLowerCase() + ",ou=requests," + basedn;
- LDAPAttribute attrRequestNextRange = new LDAPAttribute("nextRange", endRequestNum.add(oneNum)
- .toString());
+ LDAPAttribute attrRequestNextRange =
+ new LDAPAttribute("nextRange", endRequestNum.add(oneNum).toString());
LDAPModification requestmod = new LDAPModification(LDAPModification.REPLACE, attrRequestNextRange);
conn.modify(requestdn, requestmod);
@@ -777,12 +777,15 @@ public class DonePanel extends WizardPanelBase {
} else {
CMS.debug("DonePanel: Transport certificate is being setup in " + url);
String session_id = CMS.getConfigSDSessionId();
- String content = "ca.connector.KRA.enable=true&ca.connector.KRA.local=false&ca.connector.KRA.timeout=30&ca.connector.KRA.uri=/kra/agent/kra/connector&ca.connector.KRA.host="
- + ownagenthost
- + "&ca.connector.KRA.port="
- + ownagentsport
- + "&ca.connector.KRA.transportCert="
- + URLEncoder.encode(transportCert) + "&sessionID=" + session_id;
+ String content =
+ "ca.connector.KRA.enable=true&ca.connector.KRA.local=false&ca.connector.KRA.timeout=30&ca.connector.KRA.uri=/kra/agent/kra/connector&ca.connector.KRA.host="
+ + ownagenthost
+ + "&ca.connector.KRA.port="
+ + ownagentsport
+ + "&ca.connector.KRA.transportCert="
+ + URLEncoder.encode(transportCert)
+ + "&sessionID="
+ + session_id;
updateConnectorInfo(host, port, true, content);
}
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java
index 4f6df0f0b..9e0ca6f38 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java
@@ -491,9 +491,11 @@ public class NamePanel extends WizardPanelBase {
String machineName = config.getString("machineName", "");
String securePort = config.getString("service.securePort", "");
if (certTag.equals("subsystem")) {
- String content = "requestor_name=" + sysType + "-" + machineName + "-" + securePort + "&profileId="
- + profileId + "&cert_request_type=pkcs10&cert_request="
- + URLEncoder.encode(pkcs10, "UTF-8") + "&xmlOutput=true&sessionID=" + session_id;
+ String content =
+ "requestor_name="
+ + sysType + "-" + machineName + "-" + securePort + "&profileId=" + profileId
+ + "&cert_request_type=pkcs10&cert_request=" + URLEncoder.encode(pkcs10, "UTF-8")
+ + "&xmlOutput=true&sessionID=" + session_id;
cert = CertUtil.createRemoteCert(sd_hostname, sd_ee_port,
content, response, this);
if (cert == null) {
@@ -508,9 +510,11 @@ public class NamePanel extends WizardPanelBase {
} catch (Exception ee) {
}
- String content = "requestor_name=" + sysType + "-" + machineName + "-" + securePort + "&profileId="
- + profileId + "&cert_request_type=pkcs10&cert_request="
- + URLEncoder.encode(pkcs10, "UTF-8") + "&xmlOutput=true&sessionID=" + session_id;
+ String content =
+ "requestor_name="
+ + sysType + "-" + machineName + "-" + securePort + "&profileId=" + profileId
+ + "&cert_request_type=pkcs10&cert_request=" + URLEncoder.encode(pkcs10, "UTF-8")
+ + "&xmlOutput=true&sessionID=" + session_id;
cert = CertUtil.createRemoteCert(ca_hostname, ca_port,
content, response, this);
if (cert == null) {
@@ -651,8 +655,8 @@ public class NamePanel extends WizardPanelBase {
config.commit(false);
}
} catch (Exception e) {
- CMS.debug("NamePanel: configCertWithTag: Exception in setting nickname for " + ct + ": "
- + e.toString());
+ CMS.debug("NamePanel: configCertWithTag: Exception in setting nickname for "
+ + ct + ": " + e.toString());
}
configCert(request, response, context, cert);
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java
index dde150485..0ae550707 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java
@@ -456,8 +456,13 @@ public class RestoreKeyCertPanel extends WizardPanelBase {
s1.append("ca.connector.KRA");
}
- content = "op=get&names=cloning.token,instanceId,internaldb.basedn,internaldb.ldapauth.password,internaldb.replication.password,internaldb.ldapconn.host,internaldb.ldapconn.port,internaldb.ldapauth.bindDN"
- + c1.toString() + "&substores=" + s1.toString() + "&xmlOutput=true&sessionID=" + session_id;
+ content =
+ "op=get&names=cloning.token,instanceId,internaldb.basedn,internaldb.ldapauth.password,internaldb.replication.password,internaldb.ldapconn.host,internaldb.ldapconn.port,internaldb.ldapauth.bindDN"
+ + c1.toString()
+ + "&substores="
+ + s1.toString()
+ + "&xmlOutput=true&sessionID="
+ + session_id;
boolean success = updateConfigEntries(master_hostname, master_port, true,
"/" + cstype + "/admin/" + cstype + "/getConfigEntries", content, config, response);
if (!success) {
@@ -562,8 +567,8 @@ public class RestoreKeyCertPanel extends WizardPanelBase {
KeyWrapper wrapper = token.getKeyWrapper(KeyWrapAlgorithm.DES3_CBC_PAD);
wrapper.initUnwrap(sk, param);
- org.mozilla.jss.crypto.PrivateKey pp = wrapper.unwrapPrivate(encpkey, getPrivateKeyType(publickey),
- publickey);
+ org.mozilla.jss.crypto.PrivateKey pp =
+ wrapper.unwrapPrivate(encpkey, getPrivateKeyType(publickey), publickey);
} catch (Exception e) {
CMS.debug("RestoreKeyCertPanel importkeycert: Exception=" + e.toString());
@@ -604,8 +609,8 @@ public class RestoreKeyCertPanel extends WizardPanelBase {
| InternalCertificate.VALID_CA);
} else if (name.startsWith("auditSigningCert")) {
InternalCertificate icert = (InternalCertificate) xcert;
- icert.setObjectSigningTrust(InternalCertificate.USER | InternalCertificate.VALID_PEER
- | InternalCertificate.TRUSTED_PEER);
+ icert.setObjectSigningTrust(InternalCertificate.USER
+ | InternalCertificate.VALID_PEER | InternalCertificate.TRUSTED_PEER);
}
} else
cm.importCACertPackage(cert);
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java
index c4329bda2..fcb88c917 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java
@@ -70,11 +70,12 @@ public class SizePanel extends WizardPanelBase {
public PropertySet getUsage() {
PropertySet set = new PropertySet();
- Descriptor choiceDesc = new Descriptor(
- IDescriptor.CHOICE,
- "default,custom",
- null, /* no default parameter */
- "If 'default', the key size will be configured automatically. If 'custom', the key size will be set to the value of the parameter 'custom_size'.");
+ Descriptor choiceDesc =
+ new Descriptor(
+ IDescriptor.CHOICE,
+ "default,custom",
+ null, /* no default parameter */
+ "If 'default', the key size will be configured automatically. If 'custom', the key size will be set to the value of the parameter 'custom_size'.");
set.add("choice", choiceDesc);
@@ -625,8 +626,9 @@ public class SizePanel extends WizardPanelBase {
s = config.getString("preop.ecc.algorithm.list", "SHA256withEC,SHA1withEC,SHA384withEC,SHA512withEC");
context.put("ecclist", s);
- s = config.getString("preop.rsa.algorithm.list",
- "SHA256withRSA,SHA1withRSA,SHA512withRSA,MD5withRSA,MD2withRSA");
+ s =
+ config.getString("preop.rsa.algorithm.list",
+ "SHA256withRSA,SHA1withRSA,SHA512withRSA,MD5withRSA,MD2withRSA");
context.put("rsalist", s);
s = config.getString("keys.ecc.curve.list", "nistp256");
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java
index 7b381383b..93893bff1 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java
@@ -1630,8 +1630,10 @@ public class WizardPanelBase implements IWizardPanel {
int cs_port = cs.getInteger("pkicreate.admin_secure_port", -1);
int panel = getPanelNo();
String subsystem = cs.getString("cs.type", "");
- String urlVal = "https://" + cs_hostname + ":" + cs_port + "/" + toLowerCaseSubsystemType(subsystem)
- + "/admin/console/config/wizard?p=" + panel + "&subsystem=" + subsystem;
+ String urlVal =
+ "https://"
+ + cs_hostname + ":" + cs_port + "/" + toLowerCaseSubsystemType(subsystem)
+ + "/admin/console/config/wizard?p=" + panel + "&subsystem=" + subsystem;
String encodedValue = URLEncoder.encode(urlVal, "UTF-8");
String sdurl = "https://" + hostname + ":" + port + "/ca/admin/ca/securityDomainLogin?url=" + encodedValue;
response.sendRedirect(sdurl);