Class UniqueSubjectNameConstraint
- java.lang.Object
-
- com.netscape.cms.profile.constraint.EnrollConstraint
-
- com.netscape.cms.profile.constraint.UniqueSubjectNameConstraint
-
- All Implemented Interfaces:
IPolicyConstraint,IConfigTemplate
public class UniqueSubjectNameConstraint extends EnrollConstraint
This class implements the unique subject name constraint. It checks if the subject name in the certificate is unique in the internal database, ie, no two certificates have the same subject name.- Version:
- $Revision$, $Date$
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_KEY_USAGE_EXTENSION_CHECKING-
Fields inherited from class com.netscape.cms.profile.constraint.EnrollConstraint
CONFIG_NAME, CONFIG_PARAMS, mConfig, mConfigNames
-
-
Constructor Summary
Constructors Constructor Description UniqueSubjectNameConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDescriptorgetConfigDescriptor(java.util.Locale locale, java.lang.String name)Returns the descriptors of configuration parameter.java.lang.StringgetDefaultConfig(java.lang.String name)java.lang.StringgetText(java.util.Locale locale)Returns localized description of this constraint.voidinit(IProfile profile, IConfigStore config)Initializes this constraint policy.booleanisApplicable(IPolicyDefault def)Checks if this constraint is applicable to the given default policy.voidvalidate(IRequest request, X509CertInfo info)Validates the request.-
Methods inherited from class com.netscape.cms.profile.constraint.EnrollConstraint
addConfigName, getBoolean, getConfig, getConfig, getConfigBoolean, getConfigInt, getConfigNames, getConfigStore, getExtension, getInt, getLocale, getName, getValueDescriptor, isOptional, setConfig, validate
-
-
-
-
Field Detail
-
CONFIG_KEY_USAGE_EXTENSION_CHECKING
public static final java.lang.String CONFIG_KEY_USAGE_EXTENSION_CHECKING
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(IProfile profile, IConfigStore config) throws EProfileException
Description copied from interface:IPolicyConstraintInitializes this constraint policy.- Specified by:
initin interfaceIPolicyConstraint- Overrides:
initin classEnrollConstraint- Parameters:
profile- owner of this policyconfig- configuration store for this constraint- Throws:
EProfileException- failed to initialize
-
getConfigDescriptor
public IDescriptor getConfigDescriptor(java.util.Locale locale, java.lang.String name)
Description copied from interface:IConfigTemplateReturns the descriptors of configuration parameter.- Specified by:
getConfigDescriptorin interfaceIConfigTemplate- Overrides:
getConfigDescriptorin classEnrollConstraint- Parameters:
locale- user localename- configuration parameter name- Returns:
- descriptor
-
getDefaultConfig
public java.lang.String getDefaultConfig(java.lang.String name)
-
validate
public void validate(IRequest request, X509CertInfo info) throws ERejectException
Validates the request. The request is not modified during the validation. Rules are as follows: If the subject name is not unique, then the request will be rejected unless: 1. the certificate is expired or expired_revoked 2. the certificate is revoked and the revocation reason is not "on hold" 3. the keyUsageExtension bits are different and enableKeyUsageExtensionChecking=true (default)- Specified by:
validatein classEnrollConstraint- Parameters:
request- enrollment requestinfo- certificate template- Throws:
ERejectException- request is rejected due to violation of constraint
-
getText
public java.lang.String getText(java.util.Locale locale)
Description copied from interface:IPolicyConstraintReturns localized description of this constraint.- Specified by:
getTextin interfaceIPolicyConstraint- Overrides:
getTextin classEnrollConstraint- Parameters:
locale- locale of the end-user- Returns:
- localized description of this constraint
-
isApplicable
public boolean isApplicable(IPolicyDefault def)
Description copied from interface:IPolicyConstraintChecks if this constraint is applicable to the given default policy.- Specified by:
isApplicablein interfaceIPolicyConstraint- Overrides:
isApplicablein classEnrollConstraint- Parameters:
def- default policy to be checked- Returns:
- true if this constraint can be applied to the given default policy
-
-