The Constants.PR_INTERNAL_TOKEN_NAME has been replaced with CryptoUtil.INTERNAL_TOKEN_NAME since they are identical.
https://fedorahosted.org/pki/ticket/2556 Pushed to master under trivial rule. -- Endi S. Dewata
>From 6a92c5ca4cc0949a17daf9b71ca7616590779a59 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" <edew...@redhat.com> Date: Sat, 21 Jan 2017 00:37:38 +0100 Subject: [PATCH] Refactored Constants.PR_INTERNAL_TOKEN_NAME. The Constants.PR_INTERNAL_TOKEN_NAME has been replaced with CryptoUtil.INTERNAL_TOKEN_NAME since they are identical. https://fedorahosted.org/pki/ticket/2556 --- .../src/com/netscape/certsrv/common/Constants.java | 2 -- .../admin/certsrv/config/install/WICAKeyPage.java | 3 +- .../config/install/WICloneCAKeyCertPage.java | 7 ++-- .../config/install/WICloneKRAKeyCertPage.java | 7 ++-- .../config/install/WICloneOCSPKeyCertPage.java | 5 +-- .../config/install/WICloneRAKeyCertPage.java | 5 +-- .../config/install/WICloneTKSKeyCertPage.java | 3 +- .../certsrv/config/install/WIDisplayCertPage.java | 3 +- .../config/install/WIInternalTokenLogonPage.java | 5 +-- .../admin/certsrv/config/install/WIKRAKeyPage.java | 3 +- .../admin/certsrv/config/install/WIKeyPage.java | 3 +- .../certsrv/config/install/WIMigrationPage.java | 5 +-- .../certsrv/config/install/WIOCSPKeyPage.java | 3 +- .../admin/certsrv/config/install/WIRAKeyPage.java | 3 +- .../certsrv/config/install/WIServerKeyPage.java | 3 +- .../netscape/admin/certsrv/keycert/WKeyPage.java | 3 +- .../admin/certsrv/keycert/WTokenLogonPage.java | 3 +- .../cms/servlet/admin/CMSAdminServlet.java | 38 +++++++++++----------- .../src/com/netscape/cmscore/apps/CMSEngine.java | 3 +- .../netscape/cmscore/security/CASigningCert.java | 3 +- .../netscape/cmscore/security/JssSubsystem.java | 26 +++++++-------- .../cmscore/security/KRATransportCert.java | 3 +- .../com/netscape/cmscore/security/KeyCertUtil.java | 6 ++-- .../netscape/cmscore/security/OCSPSigningCert.java | 3 +- .../netscape/cmscore/security/RASigningCert.java | 3 +- .../src/com/netscape/cmscore/security/SSLCert.java | 3 +- .../cmscore/security/SSLSelfSignedCert.java | 3 +- 27 files changed, 88 insertions(+), 69 deletions(-) diff --git a/base/common/src/com/netscape/certsrv/common/Constants.java b/base/common/src/com/netscape/certsrv/common/Constants.java index 408dfbe2c3033b8890bb7583f01d161c29436015..3e941683aed3678462024ac7e1f76a415336e1a0 100644 --- a/base/common/src/com/netscape/certsrv/common/Constants.java +++ b/base/common/src/com/netscape/certsrv/common/Constants.java @@ -490,8 +490,6 @@ public interface Constants { //public final static String PR_SERVER_CERT = "servercert"; public final static String PR_CLIENT_CERT = "clientcert"; public final static String PR_FULL_INTERNAL_TOKEN_NAME = "Internal Key Storage Token"; - public final static String PR_INTERNAL_TOKEN_NAME = - "internal"; public final static String PR_TOKEN_NAME = "tokenName"; public final static String PR_TOKEN_PASSWD = "tokenPwd"; public final static String PR_KEY_LENGTH = "keyLength"; diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WICAKeyPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WICAKeyPage.java index 8c413ca01a5898da403d17f51224d3a388a9f09f..b9fa0c9ab3bb7d9cba12c452a0439cdadefa192d 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WICAKeyPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WICAKeyPage.java @@ -27,6 +27,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.config.*; /** @@ -73,7 +74,7 @@ class WICAKeyPage extends WIKeyPage implements IWizardPanel { if (caTokenName == null || caTokenName.equals("")) { mTokenBox.setSelectedIndex(0); } else { - if (caTokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (caTokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) mTokenBox.setSelectedIndex(0); else mTokenBox.setSelectedItem(caTokenName); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneCAKeyCertPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneCAKeyCertPage.java index 8f2ee32af45f5a8645dfb3328d4cadc6752a35c9..5846531e5b6419084f2f81f315fd37db1657b4d8 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneCAKeyCertPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneCAKeyCertPage.java @@ -25,6 +25,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; @@ -125,7 +126,7 @@ class WICloneCAKeyCertPage extends WizardBasePanel implements IWizardPanel { public boolean concludePanel(WizardInfo info) { String canickname = (String)mCANicknameBox.getSelectedItem(); - mCATokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mCATokenname = CryptoUtil.INTERNAL_TOKEN_NAME; int index = canickname.indexOf(":"); if (index > -1) { mCATokenname = canickname.substring(0, index); @@ -133,7 +134,7 @@ class WICloneCAKeyCertPage extends WizardBasePanel implements IWizardPanel { mWizardInfo.put(ConfigConstants.PR_CLONE_CA_TOKEN_NAME, mCATokenname); String ocspnickname = (String)mOCSPNicknameBox.getSelectedItem(); - mOCSPTokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mOCSPTokenname = CryptoUtil.INTERNAL_TOKEN_NAME; index = ocspnickname.indexOf(":"); if (index > -1) { mOCSPTokenname = ocspnickname.substring(0, index); @@ -141,7 +142,7 @@ class WICloneCAKeyCertPage extends WizardBasePanel implements IWizardPanel { mWizardInfo.put(ConfigConstants.PR_CLONE_OCSP_TOKEN_NAME, mOCSPTokenname); String sslnickname = (String)mSSLNicknameBox.getSelectedItem(); - mSSLTokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mSSLTokenname = CryptoUtil.INTERNAL_TOKEN_NAME; index = sslnickname.indexOf(":"); if (index > -1) { mSSLTokenname = sslnickname.substring(0, index); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneKRAKeyCertPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneKRAKeyCertPage.java index e32c367a2700cb6fd5ad79b9c8ecf36678aa9797..3399bf260d67a18096bcbb8246a4f77a296cb962 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneKRAKeyCertPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneKRAKeyCertPage.java @@ -25,6 +25,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; @@ -126,7 +127,7 @@ class WICloneKRAKeyCertPage extends WizardBasePanel implements IWizardPanel { public boolean concludePanel(WizardInfo info) { String kranickname = (String)mKRANicknameBox.getSelectedItem(); - mKRATokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mKRATokenname = CryptoUtil.INTERNAL_TOKEN_NAME; int index = kranickname.indexOf(":"); if (index > -1) { mKRATokenname = kranickname.substring(0, index); @@ -134,7 +135,7 @@ class WICloneKRAKeyCertPage extends WizardBasePanel implements IWizardPanel { mWizardInfo.put(ConfigConstants.PR_CLONE_KRA_TOKEN_NAME, mKRATokenname); String storagenickname = (String)mStorageNicknameBox.getSelectedItem(); - mStorageTokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mStorageTokenname = CryptoUtil.INTERNAL_TOKEN_NAME; index = storagenickname.indexOf(":"); if (index > -1) { mStorageTokenname = storagenickname.substring(0, index); @@ -142,7 +143,7 @@ class WICloneKRAKeyCertPage extends WizardBasePanel implements IWizardPanel { mWizardInfo.put(ConfigConstants.PR_CLONE_STORAGE_TOKEN_NAME, mStorageTokenname); String sslnickname = (String)mSSLNicknameBox.getSelectedItem(); - mSSLTokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mSSLTokenname = CryptoUtil.INTERNAL_TOKEN_NAME; index = sslnickname.indexOf(":"); if (index > -1) { mSSLTokenname = sslnickname.substring(0, index); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneOCSPKeyCertPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneOCSPKeyCertPage.java index 94aee9a08852c6015d906328831dc1206311a97f..288f2edc7c4def659893002a82d9580a5dbfe858 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneOCSPKeyCertPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneOCSPKeyCertPage.java @@ -25,6 +25,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; @@ -109,7 +110,7 @@ class WICloneOCSPKeyCertPage extends WizardBasePanel implements IWizardPanel { public boolean concludePanel(WizardInfo info) { String ocspnickname = (String)mOCSPNicknameBox.getSelectedItem(); - mOCSPTokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mOCSPTokenname = CryptoUtil.INTERNAL_TOKEN_NAME; int index = ocspnickname.indexOf(":"); if (index > -1) { mOCSPTokenname = ocspnickname.substring(0, index); @@ -117,7 +118,7 @@ class WICloneOCSPKeyCertPage extends WizardBasePanel implements IWizardPanel { mWizardInfo.put(ConfigConstants.PR_CLONE_OCSP_TOKEN_NAME, mOCSPTokenname); String sslnickname = (String)mSSLNicknameBox.getSelectedItem(); - mSSLTokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mSSLTokenname = CryptoUtil.INTERNAL_TOKEN_NAME; index = sslnickname.indexOf(":"); if (index > -1) { mSSLTokenname = sslnickname.substring(0, index); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneRAKeyCertPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneRAKeyCertPage.java index 63cffdea079d86b552fbba2efeb33ed0ae219ef2..7ae4f2606e160d5a06a5cfb6baad568777f987e9 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneRAKeyCertPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneRAKeyCertPage.java @@ -25,6 +25,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; @@ -111,7 +112,7 @@ class WICloneRAKeyCertPage extends WizardBasePanel implements IWizardPanel { public boolean concludePanel(WizardInfo info) { String ranickname = (String)mRANicknameBox.getSelectedItem(); - mRATokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mRATokenname = CryptoUtil.INTERNAL_TOKEN_NAME; int index = ranickname.indexOf(":"); if (index > -1) { mRATokenname = ranickname.substring(0, index); @@ -119,7 +120,7 @@ class WICloneRAKeyCertPage extends WizardBasePanel implements IWizardPanel { mWizardInfo.put(ConfigConstants.PR_CLONE_RA_TOKEN_NAME, mRATokenname); String sslnickname = (String)mSSLNicknameBox.getSelectedItem(); - mSSLTokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mSSLTokenname = CryptoUtil.INTERNAL_TOKEN_NAME; index = sslnickname.indexOf(":"); if (index > -1) { mSSLTokenname = sslnickname.substring(0, index); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneTKSKeyCertPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneTKSKeyCertPage.java index 52c1035217ed7d61c641161a59390f5988f3a4af..811e40ebc1d631a7b314df1839f8e75fdcfb6c33 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WICloneTKSKeyCertPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WICloneTKSKeyCertPage.java @@ -25,6 +25,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; @@ -95,7 +96,7 @@ class WICloneTKSKeyCertPage extends WizardBasePanel implements IWizardPanel { public boolean concludePanel(WizardInfo info) { String sslnickname = (String)mSSLNicknameBox.getSelectedItem(); - mSSLTokenname = Constants.PR_INTERNAL_TOKEN_NAME; + mSSLTokenname = CryptoUtil.INTERNAL_TOKEN_NAME; int index = sslnickname.indexOf(":"); if (index > -1) { mSSLTokenname = sslnickname.substring(0, index); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WIDisplayCertPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WIDisplayCertPage.java index ca180ad42c5524ca1e494e6b5d31d33fe3153ca7..b6c2f828c72d58ea8281cb0ee7ba8bf76fa530d3 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WIDisplayCertPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WIDisplayCertPage.java @@ -26,6 +26,7 @@ import com.netscape.admin.certsrv.connection.*; import com.netscape.management.client.util.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; @@ -81,7 +82,7 @@ class WIDisplayCertPage extends WizardBasePanel implements IWizardPanel { } } if ((tokenName != null) && - !(tokenName.equalsIgnoreCase(Constants.PR_INTERNAL_TOKEN_NAME))) { + !(tokenName.equalsIgnoreCase(CryptoUtil.INTERNAL_TOKEN_NAME))) { Debug.println("tokenName="+tokenName); mCertNameField.setText(tokenName+":"+wizardInfo.getNickname()); } else { diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WIInternalTokenLogonPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WIInternalTokenLogonPage.java index ff2adab5d670b941ccaa0abf4bb46d79fb54c5ea..79ca5a2081e616f15c52990225d895b040702577 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WIInternalTokenLogonPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WIInternalTokenLogonPage.java @@ -24,6 +24,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; @@ -55,12 +56,12 @@ class WIInternalTokenLogonPage extends WITokenLogonPage implements IWizardPanel public boolean initializePanel(WizardInfo info) { InstallWizardInfo wizardInfo = (InstallWizardInfo)info; String pwd = - (String)wizardInfo.get("TOKEN:"+Constants.PR_INTERNAL_TOKEN_NAME); + (String)wizardInfo.get("TOKEN:"+CryptoUtil.INTERNAL_TOKEN_NAME); if (pwd != null) return false; mTokenName = "Internal"; - mTokenText.setText(Constants.PR_INTERNAL_TOKEN_NAME); + mTokenText.setText(CryptoUtil.INTERNAL_TOKEN_NAME); return super.initializePanel(info); } } diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WIKRAKeyPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WIKRAKeyPage.java index 00b12d43c60f05192508633e147e29451104f8e2..b910d9ef8ca01c4e19bc43dccbaf76f4bd8577dc 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WIKRAKeyPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WIKRAKeyPage.java @@ -27,6 +27,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.config.*; /** @@ -70,7 +71,7 @@ class WIKRAKeyPage extends WIKeyPage implements IWizardPanel { if (kraTokenName == null || kraTokenName.equals("")) { mTokenBox.setSelectedIndex(0); } else { - if (kraTokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (kraTokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) mTokenBox.setSelectedIndex(0); else mTokenBox.setSelectedItem(kraTokenName); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WIKeyPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WIKeyPage.java index c45b93cdc13d6c10773f07d10b0b53ec61d584ad..217704c2a873ce45b5c7f8372b7ea4e55ef3ce11 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WIKeyPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WIKeyPage.java @@ -40,7 +40,6 @@ import com.netscape.admin.certsrv.wizard.IWizardPanel; import com.netscape.admin.certsrv.wizard.WizardBasePanel; import com.netscape.admin.certsrv.wizard.WizardInfo; import com.netscape.certsrv.common.ConfigConstants; -import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.common.OpDef; import com.netscape.certsrv.common.TaskId; import com.netscape.cmsutil.crypto.CryptoUtil; @@ -542,7 +541,7 @@ class WIKeyPage extends WizardBasePanel implements IWizardPanel, ItemListener { mWizardInfo = (InstallWizardInfo)info; String name = (String)mTokenBox.getSelectedItem(); if (name.equalsIgnoreCase(CryptoUtil.INTERNAL_TOKEN_NAME)) - name = Constants.PR_INTERNAL_TOKEN_NAME; + name = CryptoUtil.INTERNAL_TOKEN_NAME; mWizardInfo.put(ConfigConstants.PR_TOKEN_NAME, name); if (mPassword.isEditable()) { // this is used for single signon. The key is the token name with diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WIMigrationPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WIMigrationPage.java index 68faf10d019fb4b0b2ca5560f1c02a72b02ee266..10e19e7351f31ff90e332f52ce6170d46d5db2c7 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WIMigrationPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WIMigrationPage.java @@ -26,6 +26,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; @@ -232,12 +233,12 @@ class WIMigrationPage extends WizardBasePanel implements IWizardPanel, ItemListe String caTokenName = ""; String sslTokenName = ""; if (mCATokenBox.getSelectedIndex() == 0) { - caTokenName = Constants.PR_INTERNAL_TOKEN_NAME; + caTokenName = CryptoUtil.INTERNAL_TOKEN_NAME; } else { caTokenName = (String)mCATokenBox.getSelectedItem(); } if (mSSLTokenBox.getSelectedIndex() == 0) { - sslTokenName = Constants.PR_INTERNAL_TOKEN_NAME; + sslTokenName = CryptoUtil.INTERNAL_TOKEN_NAME; } else { sslTokenName = (String)mSSLTokenBox.getSelectedItem(); } diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WIOCSPKeyPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WIOCSPKeyPage.java index 63746e448978296ab3c1c1bfaa430af56b6af23f..a48e03557d07ca2475945a517a5fb7ce36ce8a3b 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WIOCSPKeyPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WIOCSPKeyPage.java @@ -27,6 +27,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.config.*; import com.netscape.management.client.util.*; @@ -67,7 +68,7 @@ class WIOCSPKeyPage extends WIKeyPage implements IWizardPanel { if (ocspTokenName == null || ocspTokenName.equals("")) { mTokenBox.setSelectedIndex(0); } else { - if (ocspTokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (ocspTokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) mTokenBox.setSelectedIndex(0); else mTokenBox.setSelectedItem(ocspTokenName); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WIRAKeyPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WIRAKeyPage.java index 619f405939d5000b4af04d383a320595e93da1ae..54007abc60b13c6f24202a0a4cd5b2aa3a9a6279 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WIRAKeyPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WIRAKeyPage.java @@ -27,6 +27,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.config.*; /** @@ -69,7 +70,7 @@ class WIRAKeyPage extends WIKeyPage implements IWizardPanel { if (raTokenName == null || raTokenName.equals("")) { mTokenBox.setSelectedIndex(0); } else { - if (raTokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (raTokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) mTokenBox.setSelectedIndex(0); else mTokenBox.setSelectedItem(raTokenName); diff --git a/base/console/src/com/netscape/admin/certsrv/config/install/WIServerKeyPage.java b/base/console/src/com/netscape/admin/certsrv/config/install/WIServerKeyPage.java index dcf93aa83deab1df72d2d93a7ac7577b8fb88978..83c98e52ded4206214c6c9feaa55b93afbf1f4f1 100644 --- a/base/console/src/com/netscape/admin/certsrv/config/install/WIServerKeyPage.java +++ b/base/console/src/com/netscape/admin/certsrv/config/install/WIServerKeyPage.java @@ -27,6 +27,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.config.*; /** @@ -68,7 +69,7 @@ class WIServerKeyPage extends WIKeyPage implements IWizardPanel { if (sslTokenName == null || sslTokenName.equals("")) { mTokenBox.setSelectedIndex(0); } else { - if (sslTokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (sslTokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) mTokenBox.setSelectedIndex(0); else mTokenBox.setSelectedItem(sslTokenName); diff --git a/base/console/src/com/netscape/admin/certsrv/keycert/WKeyPage.java b/base/console/src/com/netscape/admin/certsrv/keycert/WKeyPage.java index 6c9038ffa90e46dee0b8bc20d0ff58dca72e9f37..6c9c981ef711fee06d9b088c5d027029b0d13cf6 100644 --- a/base/console/src/com/netscape/admin/certsrv/keycert/WKeyPage.java +++ b/base/console/src/com/netscape/admin/certsrv/keycert/WKeyPage.java @@ -27,6 +27,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.admin.certsrv.config.*; import javax.swing.text.*; @@ -302,7 +303,7 @@ class WKeyPage extends WizardBasePanel implements IWizardPanel, ItemListener { if (mNewKeyBtn.isSelected()) { String tokenName = (String)mTokenBox.getSelectedItem(); if (tokenName.equals("internal")) - tokenName = Constants.PR_INTERNAL_TOKEN_NAME; + tokenName = CryptoUtil.INTERNAL_TOKEN_NAME; nvps.clear(); nvps.put(Constants.PR_TOKEN_NAME, tokenName); response = connection.process(DestDef.DEST_SERVER_ADMIN, diff --git a/base/console/src/com/netscape/admin/certsrv/keycert/WTokenLogonPage.java b/base/console/src/com/netscape/admin/certsrv/keycert/WTokenLogonPage.java index b1fd2031cf221b8959873af95ff68012e9498366..46c9b61df99d0e2e805c65677004d541cbed5923 100644 --- a/base/console/src/com/netscape/admin/certsrv/keycert/WTokenLogonPage.java +++ b/base/console/src/com/netscape/admin/certsrv/keycert/WTokenLogonPage.java @@ -24,6 +24,7 @@ import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; +import com.netscape.cmsutil.crypto.CryptoUtil; /** * This panel asks for the user to logon to the keycert token . @@ -88,7 +89,7 @@ class WTokenLogonPage extends WizardBasePanel implements IWizardPanel { String tokenname = mTokenNameText.getText().trim(); if (tokenname.equals("internal")) { - tokenname = Constants.PR_INTERNAL_TOKEN_NAME; + tokenname = CryptoUtil.INTERNAL_TOKEN_NAME; } String pwd = mPasswordText.getText().trim(); diff --git a/base/server/cms/src/com/netscape/cms/servlet/admin/CMSAdminServlet.java b/base/server/cms/src/com/netscape/cms/servlet/admin/CMSAdminServlet.java index 755c8c4f74e90d544273247a86808eb19927894a..46ac361fe6e5738fa01a37493d2a6b88f69687fa 100644 --- a/base/server/cms/src/com/netscape/cms/servlet/admin/CMSAdminServlet.java +++ b/base/server/cms/src/com/netscape/cms/servlet/admin/CMSAdminServlet.java @@ -1085,7 +1085,7 @@ public final class CMSAdminServlet extends AdminServlet { try { NameValuePairs params = new NameValuePairs(); Enumeration<String> enum1 = req.getParameterNames(); - String tokenName = Constants.PR_INTERNAL_TOKEN_NAME; + String tokenName = CryptoUtil.INTERNAL_TOKEN_NAME; String keyType = ""; int keyLength = 512; String subjectName = ""; @@ -1264,7 +1264,7 @@ public final class CMSAdminServlet extends AdminServlet { CMS.getSubsystem(CMS.SUBSYSTEM_CA); ISigningUnit signingUnit = ca.getSigningUnit(); - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) signingUnit.setNewNickName(nickname); else { if (tokenName.equals("") && nickname.equals("")) @@ -1287,7 +1287,7 @@ public final class CMSAdminServlet extends AdminServlet { IRegistrationAuthority ra = (IRegistrationAuthority) CMS.getSubsystem(CMS.SUBSYSTEM_RA); - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) ra.setNewNickName(nickname); else { if (tokenName.equals("") && nickname.equals("")) @@ -1311,7 +1311,7 @@ public final class CMSAdminServlet extends AdminServlet { if (ocsp != null) { ISigningUnit signingUnit = ocsp.getSigningUnit(); - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) signingUnit.setNewNickName(nickname); else { if (tokenName.equals("") && nickname.equals("")) @@ -1324,7 +1324,7 @@ public final class CMSAdminServlet extends AdminServlet { CMS.getSubsystem(CMS.SUBSYSTEM_CA); ISigningUnit signingUnit = ca.getOCSPSigningUnit(); - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) signingUnit.setNewNickName(nickname); else { if (tokenName.equals("") && nickname.equals("")) @@ -1356,7 +1356,7 @@ public final class CMSAdminServlet extends AdminServlet { IKeyRecoveryAuthority kra = (IKeyRecoveryAuthority) CMS.getSubsystem(CMS.SUBSYSTEM_KRA); - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) kra.setNewNickName(nickname); else { if (tokenName.equals("") && nickname.equals("")) @@ -1455,7 +1455,7 @@ public final class CMSAdminServlet extends AdminServlet { // to the signed audit log and stored as failures try { Enumeration<String> enum1 = req.getParameterNames(); - String tokenName = Constants.PR_INTERNAL_TOKEN_NAME; + String tokenName = CryptoUtil.INTERNAL_TOKEN_NAME; String keyType = "RSA"; KeyCertData properties = new KeyCertData(); @@ -1493,7 +1493,7 @@ public final class CMSAdminServlet extends AdminServlet { if (index == -1) { nicknameWithoutTokenName = nickname; - oldtokenname = Constants.PR_INTERNAL_TOKEN_NAME; + oldtokenname = CryptoUtil.INTERNAL_TOKEN_NAME; } else if (index > 0 && (index < (nickname.length() - 1))) { nicknameWithoutTokenName = nickname.substring(index + 1); oldtokenname = nickname.substring(0, index); @@ -1668,7 +1668,7 @@ public final class CMSAdminServlet extends AdminServlet { certType); nicknameWithoutTokenName = newNickname; nicknameChanged = true; - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = newNickname; } else { nickname = tokenName + ":" + newNickname; @@ -1719,7 +1719,7 @@ public final class CMSAdminServlet extends AdminServlet { if ((newtokenname != null && !newtokenname.equals(oldtokenname)) || nicknameChanged) { if (certType.equals(Constants.PR_CA_SIGNING_CERT)) { - if (newtokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (newtokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { signingUnit.updateConfig(nicknameWithoutTokenName, newtokenname); } else { @@ -1728,7 +1728,7 @@ public final class CMSAdminServlet extends AdminServlet { newtokenname); } } else if (certType.equals(Constants.PR_SERVER_CERT)) { - if (newtokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (newtokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = nicknameWithoutTokenName; } else { nickname = newtokenname + ":" @@ -1749,7 +1749,7 @@ public final class CMSAdminServlet extends AdminServlet { modifyCAGatewayCert(ca, nickname); } } else if (certType.equals(Constants.PR_SERVER_CERT_RADM)) { - if (newtokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (newtokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = nicknameWithoutTokenName; } else { nickname = newtokenname + ":" @@ -1761,7 +1761,7 @@ public final class CMSAdminServlet extends AdminServlet { if (ca != null) { ISigningUnit ocspSigningUnit = ca.getOCSPSigningUnit(); - if (newtokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (newtokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { ocspSigningUnit.updateConfig( nicknameWithoutTokenName, newtokenname); } else { @@ -1869,7 +1869,7 @@ public final class CMSAdminServlet extends AdminServlet { // ensure that any low-level exceptions are reported // to the signed audit log and stored as failures try { - String tokenName = Constants.PR_INTERNAL_TOKEN_NAME; + String tokenName = CryptoUtil.INTERNAL_TOKEN_NAME; String pkcs = ""; String certType = ""; String nickname = ""; @@ -2067,7 +2067,7 @@ public final class CMSAdminServlet extends AdminServlet { jssSubSystem.importCert(pkcs, newNickname, certType); nicknameWithoutTokenName = newNickname; - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = newNickname; } else { nickname = tokenName + ":" + newNickname; @@ -2091,9 +2091,9 @@ public final class CMSAdminServlet extends AdminServlet { if (nickname.equals(nicknameWithoutTokenName)) { signingUnit.updateConfig(nickname, - Constants.PR_INTERNAL_TOKEN_NAME); + CryptoUtil.INTERNAL_TOKEN_NAME); extensions = jssSubSystem.getExtensions( - Constants.PR_INTERNAL_TOKEN_NAME, nickname); + CryptoUtil.INTERNAL_TOKEN_NAME, nickname); } else { String tokenname1 = nickname.substring(0, index); @@ -2142,7 +2142,7 @@ public final class CMSAdminServlet extends AdminServlet { if (nickname.equals(nicknameWithoutTokenName)) { signingUnit.updateConfig(nickname, - Constants.PR_INTERNAL_TOKEN_NAME); + CryptoUtil.INTERNAL_TOKEN_NAME); } else { String tokenname1 = nickname.substring(0, index); @@ -2156,7 +2156,7 @@ public final class CMSAdminServlet extends AdminServlet { if (nickname.equals(nicknameWithoutTokenName)) { signingUnit.updateConfig(nickname, - Constants.PR_INTERNAL_TOKEN_NAME); + CryptoUtil.INTERNAL_TOKEN_NAME); } else { String tokenname1 = nickname.substring(0, index); diff --git a/base/server/cmscore/src/com/netscape/cmscore/apps/CMSEngine.java b/base/server/cmscore/src/com/netscape/cmscore/apps/CMSEngine.java index ab10be91b8ba21f8fb66eb62f3348d3a0f85c50d..9001e9ea68d466330269760af06249a6fb545653 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/apps/CMSEngine.java +++ b/base/server/cmscore/src/com/netscape/cmscore/apps/CMSEngine.java @@ -165,6 +165,7 @@ import com.netscape.cmscore.session.SessionTimer; import com.netscape.cmscore.time.SimpleTimeSource; import com.netscape.cmscore.usrgrp.UGSubsystem; import com.netscape.cmscore.util.Debug; +import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.cmsutil.net.ISocketFactory; import com.netscape.cmsutil.password.IPasswordStore; import com.netscape.cmsutil.password.NuxwdogPasswordStore; @@ -1447,7 +1448,7 @@ public class CMSEngine implements ICMSEngine { nickName) { String newName = null; - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME) || + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME) || tokenName.equalsIgnoreCase("Internal Key Storage Token")) newName = nickName; else { diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/CASigningCert.java b/base/server/cmscore/src/com/netscape/cmscore/security/CASigningCert.java index 701ac4c185c4d767344cb27566c2080730c83d61..4cf9501a5aa35e7a24e805061c963132fe7532f5 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/security/CASigningCert.java +++ b/base/server/cmscore/src/com/netscape/cmscore/security/CASigningCert.java @@ -32,6 +32,7 @@ import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.common.ConfigConstants; import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.security.KeyCertData; +import com.netscape.cmsutil.crypto.CryptoUtil; /** * CA signing certificate. @@ -128,7 +129,7 @@ public class CASigningCert extends CertificateInfo { throw new EBaseException(CMS.getUserMessage("CMS_BASE_ALG_NOT_SUPPORTED", keyType)); cmsFileTmp.putString("ca.signing.defaultSigningAlgorithm", alg); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) cmsFileTmp.putString("ca.signing.cacertnickname", nickname); else cmsFileTmp.putString("ca.signing.cacertnickname", diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java b/base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java index 77967dc8acf21c97106b972d0177e358bb4e14e0..d8166d889db67c8a8e60201670b2661b7f2b70c5 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java +++ b/base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java @@ -540,7 +540,7 @@ public final class JssSubsystem implements ICryptoSubsystem { public boolean isTokenLoggedIn(String name) throws EBaseException { try { - if (name.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (name.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) name = Constants.PR_FULL_INTERNAL_TOKEN_NAME; CryptoToken ctoken = mCryptoManager.getTokenByName(name); @@ -905,7 +905,7 @@ public final class JssSubsystem implements ICryptoSubsystem { } public KeyPair getKeyPair(KeyCertData properties) throws EBaseException { - String tokenname = Constants.PR_INTERNAL_TOKEN_NAME; + String tokenname = CryptoUtil.INTERNAL_TOKEN_NAME; String keyType = "RSA"; int keyLength = 512; @@ -927,7 +927,7 @@ public final class JssSubsystem implements ICryptoSubsystem { } public KeyPair getECCKeyPair(KeyCertData properties) throws EBaseException { - String token = Constants.PR_INTERNAL_TOKEN_NAME; + String token = CryptoUtil.INTERNAL_TOKEN_NAME; String keyCurve = "nistp521"; String certType = null; KeyPair pair = null; @@ -951,7 +951,7 @@ public final class JssSubsystem implements ICryptoSubsystem { KeyPair pair = null; if ((token == null) || (token.equals(""))) - token = Constants.PR_INTERNAL_TOKEN_NAME; + token = CryptoUtil.INTERNAL_TOKEN_NAME; if ((keyCurve == null) || (keyCurve.equals(""))) keyCurve = "nistp521"; @@ -1078,7 +1078,7 @@ public final class JssSubsystem implements ICryptoSubsystem { String issuername) throws EBaseException { int index = nickname.indexOf(":"); String tokenname = nickname.substring(0, index); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = nickname.substring(index + 1); } try { @@ -1166,8 +1166,8 @@ public final class JssSubsystem implements ICryptoSubsystem { + list[i].getNickname()); } catch (ObjectNotFoundException e) { String nickname = list[i].getNickname(); - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { - nickname = Constants.PR_INTERNAL_TOKEN_NAME + ":" + nickname; + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { + nickname = CryptoUtil.INTERNAL_TOKEN_NAME + ":" + nickname; } X509CertImpl impl = null; @@ -1236,9 +1236,9 @@ public final class JssSubsystem implements ICryptoSubsystem { PrivateKey key = CryptoManager.getInstance().findPrivKeyByCert(list[i]); // check for errors String nickname = list[i].getNickname(); - if (tokenName.equals(Constants.PR_INTERNAL_TOKEN_NAME) || + if (tokenName.equals(CryptoUtil.INTERNAL_TOKEN_NAME) || tokenName.equals(Constants.PR_FULL_INTERNAL_TOKEN_NAME)) { - nickname = Constants.PR_INTERNAL_TOKEN_NAME + ":" + nickname; + nickname = CryptoUtil.INTERNAL_TOKEN_NAME + ":" + nickname; } X509CertImpl impl = null; @@ -1745,7 +1745,7 @@ public final class JssSubsystem implements ICryptoSubsystem { int index = nickname.indexOf(":"); String tokenname = nickname.substring(0, index); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = nickname.substring(index + 1); } try { @@ -1783,7 +1783,7 @@ public final class JssSubsystem implements ICryptoSubsystem { String issuerName) throws EBaseException { int index = nickname.indexOf(":"); String tokenname = nickname.substring(0, index); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = nickname.substring(index + 1); } try { @@ -1829,7 +1829,7 @@ public final class JssSubsystem implements ICryptoSubsystem { String issuerName, Locale locale) throws EBaseException { int index = nickname.indexOf(":"); String tokenname = nickname.substring(0, index); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = nickname.substring(index + 1); } try { @@ -1873,7 +1873,7 @@ public final class JssSubsystem implements ICryptoSubsystem { String issuerName, Locale locale) throws EBaseException { int index = nickname.indexOf(":"); String tokenname = nickname.substring(0, index); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { nickname = nickname.substring(index + 1); } try { diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/KRATransportCert.java b/base/server/cmscore/src/com/netscape/cmscore/security/KRATransportCert.java index 58c2697962ad65f518d18f374b362774f6a9565c..9f8ef75c789589a35ecb2e25ddb21bc2cf277446 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/security/KRATransportCert.java +++ b/base/server/cmscore/src/com/netscape/cmscore/security/KRATransportCert.java @@ -27,6 +27,7 @@ import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.common.ConfigConstants; import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.security.KeyCertData; +import com.netscape.cmsutil.crypto.CryptoUtil; /** * KRA transport certificate @@ -51,7 +52,7 @@ public class KRATransportCert extends CertificateInfo { String tokenname = (String) mProperties.get(Constants.PR_TOKEN_NAME); String nickname = getNickname(); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) cmsFileTmp.putString("kra.transportUnit.nickName", nickname); else cmsFileTmp.putString("kra.transportUnit.nickName", tokenname + ":" + nickname); diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/KeyCertUtil.java b/base/server/cmscore/src/com/netscape/cmscore/security/KeyCertUtil.java index 4fa20261e0e93f88ef51952ea7237e636f50e3a4..f8d2ebd4779e1d1b497f584c7f42b3308f18c3dc 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/security/KeyCertUtil.java +++ b/base/server/cmscore/src/com/netscape/cmscore/security/KeyCertUtil.java @@ -339,7 +339,7 @@ public class KeyCertUtil { CryptoManager manager = CryptoManager.getInstance(); CryptoToken token = null; - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { token = manager.getInternalKeyStorageToken(); } else { token = manager.getTokenByName(tokenname); @@ -500,7 +500,7 @@ public class KeyCertUtil { CryptoToken token = null; if (tokenName.equalsIgnoreCase(CryptoUtil.INTERNAL_TOKEN_NAME)) - tokenName = Constants.PR_INTERNAL_TOKEN_NAME; + tokenName = CryptoUtil.INTERNAL_TOKEN_NAME; try { if (tokenName.equalsIgnoreCase(CryptoUtil.INTERNAL_TOKEN_NAME)) { @@ -1124,7 +1124,7 @@ public class KeyCertUtil { IOException, CertificateException { String fullnickname = nickname; - if (!tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (!tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) fullnickname = tokenname + ":" + nickname; CryptoManager manager = CryptoManager.getInstance(); X509Certificate cert = manager.findCertByNickname(fullnickname); diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/OCSPSigningCert.java b/base/server/cmscore/src/com/netscape/cmscore/security/OCSPSigningCert.java index 08cdd92e8a1b0a6c95afe972680e1aeb65c3f4b5..f60600f6eb38815716b6aaa8f7d8c5fc234a7613 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/security/OCSPSigningCert.java +++ b/base/server/cmscore/src/com/netscape/cmscore/security/OCSPSigningCert.java @@ -32,6 +32,7 @@ import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.common.ConfigConstants; import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.security.KeyCertData; +import com.netscape.cmsutil.crypto.CryptoUtil; /** * OCSP signing certificate. @@ -106,7 +107,7 @@ public class OCSPSigningCert extends CertificateInfo { throw new EBaseException(CMS.getUserMessage("CMS_BASE_ALG_NOT_SUPPORTED", keyType)); cmsFileTmp.putString("ca.signing.defaultSigningAlgorithm", alg); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) cmsFileTmp.putString("ca.signing.cacertnickname", nickname); else cmsFileTmp.putString("ca.signing.cacertnickname", diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/RASigningCert.java b/base/server/cmscore/src/com/netscape/cmscore/security/RASigningCert.java index 51e05b5e97900630a702ddccdfc90e7e8a8e4fe7..b5c2acfd40dda7fb70c6f65e610eca2c2772f054 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/security/RASigningCert.java +++ b/base/server/cmscore/src/com/netscape/cmscore/security/RASigningCert.java @@ -27,6 +27,7 @@ import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.common.ConfigConstants; import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.security.KeyCertData; +import com.netscape.cmsutil.crypto.CryptoUtil; /** * RA signing certificate @@ -57,7 +58,7 @@ public class RASigningCert extends CertificateInfo { String tokenname = (String) mProperties.get(Constants.PR_TOKEN_NAME); String nickname = getNickname(); - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) cmsFileTmp.putString("ra.certNickname", nickname); else cmsFileTmp.putString("ra.certNickname", tokenname + ":" + nickname); diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/SSLCert.java b/base/server/cmscore/src/com/netscape/cmscore/security/SSLCert.java index 99b920c98574926a2d017cb49a1f9fafd3d2378a..a7d5f79926eb3ce01d5974e3a5ba14ffd912812f 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/security/SSLCert.java +++ b/base/server/cmscore/src/com/netscape/cmscore/security/SSLCert.java @@ -27,6 +27,7 @@ import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.common.ConfigConstants; import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.security.KeyCertData; +import com.netscape.cmsutil.crypto.CryptoUtil; /** * SSL server certificate @@ -62,7 +63,7 @@ public class SSLCert extends CertificateInfo { String nickname = getNickname(); String fullNickname = ""; - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { fullNickname = nickname; } else { fullNickname = tokenname + ":" + nickname; diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/SSLSelfSignedCert.java b/base/server/cmscore/src/com/netscape/cmscore/security/SSLSelfSignedCert.java index 8cee1d155f833ccdd63f39f0672367d5e457eda3..66b20c47ed838dd18bf22fc0dfd2684694a77034 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/security/SSLSelfSignedCert.java +++ b/base/server/cmscore/src/com/netscape/cmscore/security/SSLSelfSignedCert.java @@ -27,6 +27,7 @@ import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.common.ConfigConstants; import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.security.KeyCertData; +import com.netscape.cmsutil.crypto.CryptoUtil; /** * SSL server certificate @@ -56,7 +57,7 @@ public class SSLSelfSignedCert extends CertificateInfo { String nickname = getNickname(); String fullNickname = ""; - if (tokenname.equals(Constants.PR_INTERNAL_TOKEN_NAME)) { + if (tokenname.equals(CryptoUtil.INTERNAL_TOKEN_NAME)) { fullNickname = nickname; } else { fullNickname = tokenname + ":" + nickname; -- 2.5.5
_______________________________________________ Pki-devel mailing list Pki-devel@redhat.com https://www.redhat.com/mailman/listinfo/pki-devel