com.netscape.cms.profile.constraint
Class NSCertTypeExtConstraint

java.lang.Object
  extended by com.netscape.cms.profile.constraint.EnrollConstraint
      extended by com.netscape.cms.profile.constraint.NSCertTypeExtConstraint
All Implemented Interfaces:
IPolicyConstraint, IConfigTemplate

public class NSCertTypeExtConstraint
extends EnrollConstraint

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: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Field Summary
static java.lang.String CONFIG_CRITICAL
           
static java.lang.String CONFIG_EMAIL
           
static java.lang.String CONFIG_EMAIL_CA
           
static java.lang.String CONFIG_OBJECT_SIGNING
           
static java.lang.String CONFIG_OBJECT_SIGNING_CA
           
static java.lang.String CONFIG_SSL_CA
           
static java.lang.String CONFIG_SSL_CLIENT
           
static java.lang.String CONFIG_SSL_SERVER
           
 
Fields inherited from class com.netscape.cms.profile.constraint.EnrollConstraint
CONFIG_NAME, mConfig, mConfigNames
 
Constructor Summary
NSCertTypeExtConstraint()
           
 
Method Summary
 IDescriptor getConfigDescriptor(java.util.Locale locale, java.lang.String name)
          Returns the descriptors of configuration parameter.
 java.lang.String getText(java.util.Locale locale)
          Returns localized description of this constraint.
 void init(IProfile profile, IConfigStore config)
          Initializes this constraint policy.
 boolean isApplicable(IPolicyDefault def)
          Checks if this constraint is applicable to the given default policy.
 void validate(IRequest request, netscape.security.x509.X509CertInfo info)
          Validates the request.
 
Methods inherited from class com.netscape.cms.profile.constraint.EnrollConstraint
addConfigName, getBoolean, getConfig, getConfigBoolean, getConfigInt, getConfigNames, getConfigStore, getExtension, getInt, getLocale, getName, getValueDescriptor, isOptional, setConfig, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_CRITICAL

public static final java.lang.String CONFIG_CRITICAL
See Also:
Constant Field Values

CONFIG_SSL_CLIENT

public static final java.lang.String CONFIG_SSL_CLIENT
See Also:
Constant Field Values

CONFIG_SSL_SERVER

public static final java.lang.String CONFIG_SSL_SERVER
See Also:
Constant Field Values

CONFIG_EMAIL

public static final java.lang.String CONFIG_EMAIL
See Also:
Constant Field Values

CONFIG_OBJECT_SIGNING

public static final java.lang.String CONFIG_OBJECT_SIGNING
See Also:
Constant Field Values

CONFIG_SSL_CA

public static final java.lang.String CONFIG_SSL_CA
See Also:
Constant Field Values

CONFIG_EMAIL_CA

public static final java.lang.String CONFIG_EMAIL_CA
See Also:
Constant Field Values

CONFIG_OBJECT_SIGNING_CA

public static final java.lang.String CONFIG_OBJECT_SIGNING_CA
See Also:
Constant Field Values
Constructor Detail

NSCertTypeExtConstraint

public NSCertTypeExtConstraint()
Method Detail

init

public void init(IProfile profile,
                 IConfigStore config)
          throws EProfileException
Description copied from interface: IPolicyConstraint
Initializes this constraint policy.

Specified by:
init in interface IPolicyConstraint
Overrides:
init in class EnrollConstraint
Parameters:
profile - owner of this policy
config - 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: IConfigTemplate
Returns the descriptors of configuration parameter.

Specified by:
getConfigDescriptor in interface IConfigTemplate
Overrides:
getConfigDescriptor in class EnrollConstraint
Parameters:
locale - user locale
name - configuration parameter name
Returns:
descriptor

validate

public void validate(IRequest request,
                     netscape.security.x509.X509CertInfo info)
              throws ERejectException
Validates the request. The request is not modified during the validation.

Specified by:
validate in class EnrollConstraint
Parameters:
request - enrollment request
info - 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: IPolicyConstraint
Returns localized description of this constraint.

Specified by:
getText in interface IPolicyConstraint
Overrides:
getText in class EnrollConstraint
Parameters:
locale - locale of the end-user
Returns:
localized description of this constraint

isApplicable

public boolean isApplicable(IPolicyDefault def)
Description copied from interface: IPolicyConstraint
Checks if this constraint is applicable to the given default policy.

Specified by:
isApplicable in interface IPolicyConstraint
Overrides:
isApplicable in class EnrollConstraint
Parameters:
def - default policy to be checked
Returns:
true if this constraint can be applied to the given default policy