com.netscape.cms.profile.constraint
Class CAValidityConstraint

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

public class CAValidityConstraint
extends CAEnrollConstraint

This class implements the validity constraint. It checks if the validity in the certificate template is within the CA's validity.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Field Summary
 
Fields inherited from class com.netscape.cms.profile.constraint.EnrollConstraint
CONFIG_NAME, mConfig, mConfigNames
 
Constructor Summary
CAValidityConstraint()
           
 
Method Summary
 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.CAEnrollConstraint
getCACert
 
Methods inherited from class com.netscape.cms.profile.constraint.EnrollConstraint
addConfigName, getBoolean, getConfig, getConfigBoolean, getConfigDescriptor, 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
 

Constructor Detail

CAValidityConstraint

public CAValidityConstraint()
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

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