summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/profile/constraint/NSCertTypeExtConstraint.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/profile/constraint/NSCertTypeExtConstraint.java')
-rw-r--r--pki/base/common/src/com/netscape/cms/profile/constraint/NSCertTypeExtConstraint.java88
1 files changed, 43 insertions, 45 deletions
diff --git a/pki/base/common/src/com/netscape/cms/profile/constraint/NSCertTypeExtConstraint.java b/pki/base/common/src/com/netscape/cms/profile/constraint/NSCertTypeExtConstraint.java
index fe20b766c..843360542 100644
--- a/pki/base/common/src/com/netscape/cms/profile/constraint/NSCertTypeExtConstraint.java
+++ b/pki/base/common/src/com/netscape/cms/profile/constraint/NSCertTypeExtConstraint.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.profile.constraint;
-
import java.util.Locale;
import netscape.security.extensions.NSCertTypeExtension;
@@ -36,12 +35,11 @@ import com.netscape.cms.profile.def.NSCertTypeExtDefault;
import com.netscape.cms.profile.def.NoDefault;
import com.netscape.cms.profile.def.UserExtensionDefault;
-
/**
* This class implements the Netscape certificate type extension constraint.
* It checks if the Netscape certificate type extension in the certificate
* template satisfies the criteria.
- *
+ *
* @version $Revision$, $Date$
*/
public class NSCertTypeExtConstraint extends EnrollConstraint {
@@ -68,11 +66,11 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
}
public void init(IProfile profile, IConfigStore config)
- throws EProfileException {
+ throws EProfileException {
super.init(profile, config);
}
- public IDescriptor getConfigDescriptor(Locale locale, String name) {
+ public IDescriptor getConfigDescriptor(Locale locale, String name) {
if (name.equals(CONFIG_CRITICAL)) {
return new Descriptor(IDescriptor.CHOICE, "true,false,-",
"-",
@@ -104,8 +102,8 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
} else if (name.equals(CONFIG_OBJECT_SIGNING_CA)) {
return new Descriptor(IDescriptor.CHOICE, "true,false,-",
"-",
- CMS.getUserMessage(locale,
- "CMS_PROFILE_OBJECT_SIGNING_CA"));
+ CMS.getUserMessage(locale,
+ "CMS_PROFILE_OBJECT_SIGNING_CA"));
}
return null;
}
@@ -115,16 +113,16 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
* during the validation.
*/
public void validate(IRequest request, X509CertInfo info)
- throws ERejectException {
+ throws ERejectException {
NSCertTypeExtension ext = (NSCertTypeExtension)
- getExtension(NSCertTypeExtension.CertType_Id.toString(), info);
+ getExtension(NSCertTypeExtension.CertType_Id.toString(), info);
if (ext == null) {
throw new ERejectException(
CMS.getUserMessage(
- getLocale(request),
- "CMS_PROFILE_EXTENSION_NOT_FOUND",
- NSCertTypeExtension.CertType_Id.toString()));
+ getLocale(request),
+ "CMS_PROFILE_EXTENSION_NOT_FOUND",
+ NSCertTypeExtension.CertType_Id.toString()));
}
String value = getConfig(CONFIG_CRITICAL);
@@ -132,10 +130,10 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
if (!isOptional(value)) {
boolean critical = getBoolean(value);
- if (critical != ext.isCritical()) {
- throw new ERejectException(
- CMS.getUserMessage(getLocale(request),
- "CMS_PROFILE_CRITICAL_NOT_MATCHED"));
+ if (critical != ext.isCritical()) {
+ throw new ERejectException(
+ CMS.getUserMessage(getLocale(request),
+ "CMS_PROFILE_CRITICAL_NOT_MATCHED"));
}
}
value = getConfig(CONFIG_SSL_CLIENT);
@@ -143,10 +141,10 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
boolean bit = getBoolean(value);
if (bit != ext.isSet(0)) {
- throw new ERejectException(
- CMS.getUserMessage(getLocale(request),
- "CMS_PROFILE_SSL_CLIENT_NOT_MATCHED",
- value));
+ throw new ERejectException(
+ CMS.getUserMessage(getLocale(request),
+ "CMS_PROFILE_SSL_CLIENT_NOT_MATCHED",
+ value));
}
}
value = getConfig(CONFIG_SSL_SERVER);
@@ -154,10 +152,10 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
boolean bit = getBoolean(value);
if (bit != ext.isSet(1)) {
- throw new ERejectException(
- CMS.getUserMessage(getLocale(request),
- "CMS_PROFILE_SSL_SERVER_NOT_MATCHED",
- value));
+ throw new ERejectException(
+ CMS.getUserMessage(getLocale(request),
+ "CMS_PROFILE_SSL_SERVER_NOT_MATCHED",
+ value));
}
}
value = getConfig(CONFIG_EMAIL);
@@ -165,10 +163,10 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
boolean bit = getBoolean(value);
if (bit != ext.isSet(2)) {
- throw new ERejectException(
- CMS.getUserMessage(getLocale(request),
- "CMS_PROFILE_EMAIL_NOT_MATCHED",
- value));
+ throw new ERejectException(
+ CMS.getUserMessage(getLocale(request),
+ "CMS_PROFILE_EMAIL_NOT_MATCHED",
+ value));
}
}
value = getConfig(CONFIG_OBJECT_SIGNING);
@@ -176,10 +174,10 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
boolean bit = getBoolean(value);
if (bit != ext.isSet(3)) {
- throw new ERejectException(
- CMS.getUserMessage(getLocale(request),
- "CMS_PROFILE_OBJECT_SIGNING_NOT_MATCHED",
- value));
+ throw new ERejectException(
+ CMS.getUserMessage(getLocale(request),
+ "CMS_PROFILE_OBJECT_SIGNING_NOT_MATCHED",
+ value));
}
}
value = getConfig(CONFIG_SSL_CA);
@@ -187,10 +185,10 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
boolean bit = getBoolean(value);
if (bit != ext.isSet(4)) {
- throw new ERejectException(
- CMS.getUserMessage(getLocale(request),
- "CMS_PROFILE_SSL_CA_NOT_MATCHED",
- value));
+ throw new ERejectException(
+ CMS.getUserMessage(getLocale(request),
+ "CMS_PROFILE_SSL_CA_NOT_MATCHED",
+ value));
}
}
value = getConfig(CONFIG_EMAIL_CA);
@@ -198,10 +196,10 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
boolean bit = getBoolean(value);
if (bit != ext.isSet(5)) {
- throw new ERejectException(
- CMS.getUserMessage(getLocale(request),
- "CMS_PROFILE_EMAIL_CA_NOT_MATCHED",
- value));
+ throw new ERejectException(
+ CMS.getUserMessage(getLocale(request),
+ "CMS_PROFILE_EMAIL_CA_NOT_MATCHED",
+ value));
}
}
value = getConfig(CONFIG_OBJECT_SIGNING_CA);
@@ -209,10 +207,10 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
boolean bit = getBoolean(value);
if (bit != ext.isSet(6)) {
- throw new ERejectException(
- CMS.getUserMessage(getLocale(request),
- "CMS_PROFILE_OBJECT_SIGNING_CA_NOT_MATCHED",
- value));
+ throw new ERejectException(
+ CMS.getUserMessage(getLocale(request),
+ "CMS_PROFILE_OBJECT_SIGNING_CA_NOT_MATCHED",
+ value));
}
}
}
@@ -229,7 +227,7 @@ public class NSCertTypeExtConstraint extends EnrollConstraint {
getConfig(CONFIG_OBJECT_SIGNING_CA)
};
- return CMS.getUserMessage(locale,
+ return CMS.getUserMessage(locale,
"CMS_PROFILE_CONSTRAINT_NS_CERT_EXT_TEXT", params);
}