Class KeyConstraint

  • All Implemented Interfaces:
    com.netscape.certsrv.property.IConfigTemplate

    public class KeyConstraint
    extends EnrollConstraint
    This constraint is to check the key type and key length.
    Version:
    $Revision$, $Date$
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
      • CONFIG_KEY_PARAMETERS

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

      • KeyConstraint

        public KeyConstraint()
    • Method Detail

      • init

        public void init​(IConfigStore config)
                  throws com.netscape.certsrv.profile.EProfileException
        Description copied from class: PolicyConstraint
        Initializes this constraint policy.
        Overrides:
        init in class EnrollConstraint
        Parameters:
        config - configuration store for this constraint
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to initialize
      • getConfigDescriptor

        public com.netscape.certsrv.property.IDescriptor getConfigDescriptor​(java.util.Locale locale,
                                                                             java.lang.String name)
        Description copied from interface: com.netscape.certsrv.property.IConfigTemplate
        Returns the descriptors of configuration parameter.
        Specified by:
        getConfigDescriptor in interface com.netscape.certsrv.property.IConfigTemplate
        Overrides:
        getConfigDescriptor in class EnrollConstraint
        Parameters:
        locale - user locale
        name - configuration parameter name
        Returns:
        descriptor
      • validate

        public void validate​(com.netscape.certsrv.request.IRequest request,
                             org.mozilla.jss.netscape.security.x509.X509CertInfo info)
                      throws com.netscape.certsrv.profile.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:
        com.netscape.certsrv.profile.ERejectException - request is rejected due to violation of constraint
      • getRSAKeyLen

        public int getRSAKeyLen​(org.mozilla.jss.netscape.security.x509.X509Key key)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getDSAKeyLen

        public int getDSAKeyLen​(org.mozilla.jss.netscape.security.x509.X509Key key)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getText

        public java.lang.String getText​(java.util.Locale locale)
        Description copied from class: PolicyConstraint
        Returns localized description of this constraint.
        Overrides:
        getText in class EnrollConstraint
        Parameters:
        locale - locale of the end-user
        Returns:
        localized description of this constraint
      • isApplicable

        public boolean isApplicable​(PolicyDefault def)
        Description copied from class: PolicyConstraint
        Checks if this constraint is applicable to the given default policy.
        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
      • setConfig

        public void setConfig​(java.lang.String name,
                              java.lang.String value)
                       throws com.netscape.certsrv.property.EPropertyException
        Description copied from interface: com.netscape.certsrv.property.IConfigTemplate
        Sets configuration parameter.
        Specified by:
        setConfig in interface com.netscape.certsrv.property.IConfigTemplate
        Overrides:
        setConfig in class EnrollConstraint
        Parameters:
        name - parameter name
        value - parameter value
        Throws:
        com.netscape.certsrv.property.EPropertyException - failed to set parameter