Class EnrollDefault

    • Constructor Summary

      Constructors 
      Constructor Description
      EnrollDefault()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addConfigName​(java.lang.String name)  
      protected void addExtension​(java.lang.String name, org.mozilla.jss.netscape.security.x509.Extension ext, org.mozilla.jss.netscape.security.x509.X509CertInfo info)  
      void addValueName​(java.lang.String name)  
      protected static java.lang.String buildRecords​(java.util.Vector<NameValuePairs> recs)  
      protected void deleteExtension​(java.lang.String extID, org.mozilla.jss.netscape.security.x509.X509CertInfo info)  
      protected boolean getBoolean​(java.lang.String value)  
      byte[] getBytes​(java.lang.String string)
      Converts string containing pairs of characters in the range of '0' to '9', 'a' to 'f' to an array of bytes such that each pair of characters in the string represents an individual byte
      java.lang.String getConfig​(java.lang.String name)
      Retrieves configuration parameter by name.
      java.lang.String getConfig​(java.lang.String name, java.lang.String defval)
      Get constraint parameter in profile configuration.
      protected boolean getConfigBoolean​(java.lang.String value)  
      IDescriptor getConfigDescriptor​(java.util.Locale locale, java.lang.String name)
      Returns the descriptors of configuration parameter.
      protected int getConfigInt​(java.lang.String value)  
      java.util.Enumeration<java.lang.String> getConfigNames()
      Returns a list of configuration parameter names.
      IConfigStore getConfigStore()
      Retrieves the configuration store of this default.
      protected org.mozilla.jss.netscape.security.x509.Extension getExtension​(java.lang.String name, org.mozilla.jss.netscape.security.x509.CertificateExtensions exts)  
      protected org.mozilla.jss.netscape.security.x509.Extension getExtension​(java.lang.String name, org.mozilla.jss.netscape.security.x509.X509CertInfo info)  
      protected static java.lang.String getGeneralNameType​(org.mozilla.jss.netscape.security.x509.GeneralName gn)  
      protected static java.lang.String getGeneralNameValue​(org.mozilla.jss.netscape.security.x509.GeneralName gn)  
      protected int getInt​(java.lang.String value)  
      java.util.Locale getLocale​(IRequest request)  
      java.lang.String getName​(java.util.Locale locale)
      Retrieves the localizable name of this policy.
      abstract java.lang.String getText​(java.util.Locale locale)
      Retrieves the localizable description of this policy.
      java.lang.String getValue​(java.lang.String name, java.util.Locale locale, IRequest request)
      Retrieves the value of the given value property by name.
      abstract java.lang.String getValue​(java.lang.String name, java.util.Locale locale, org.mozilla.jss.netscape.security.x509.X509CertInfo info)
      Retrieves certificate template values and returns them to the approval page.
      IDescriptor getValueDescriptor​(java.lang.String name)  
      java.util.Enumeration<java.lang.String> getValueNames()
      Retrieves a list of names of the property.
      void init​(IConfigStore config)
      Initializes this default policy.
      protected boolean isGeneralNameType​(java.lang.String nameType)  
      protected boolean isGeneralNameValid​(java.lang.String name)  
      protected boolean isOptional​(java.lang.String value)  
      boolean isValidOID​(java.lang.String oid)
      Check if a object identifier in string form is valid, that is a string in the form n.n.n.n and der encode and decode-able.
      protected java.lang.String mapPattern​(IRequest request, java.lang.String pattern)  
      protected org.mozilla.jss.netscape.security.x509.GeneralNameInterface parseGeneralName​(java.lang.String name)  
      protected org.mozilla.jss.netscape.security.x509.GeneralNameInterface parseGeneralName​(java.lang.String nameType, java.lang.String nameValue)  
      protected java.util.Vector<NameValuePairs> parseRecords​(java.lang.String value)  
      void populate​(IRequest request)
      Populates the request with this policy default.
      abstract void populate​(IRequest request, org.mozilla.jss.netscape.security.x509.X509CertInfo info)
      Populates attributes into the certificate template.
      protected void refreshConfigAndValueNames()  
      protected void replaceExtension​(java.lang.String name, org.mozilla.jss.netscape.security.x509.Extension ext, org.mozilla.jss.netscape.security.x509.X509CertInfo info)  
      void setConfig​(java.lang.String name, java.lang.String value)
      Sets configuration parameter.
      void setValue​(java.lang.String name, java.util.Locale locale, IRequest request, java.lang.String value)
      Sets the value of the given value property by name.
      abstract void setValue​(java.lang.String name, java.util.Locale locale, org.mozilla.jss.netscape.security.x509.X509CertInfo info, java.lang.String value)
      Sets values from the approval page into certificate template.
      java.lang.String toGeneralNameString​(org.mozilla.jss.netscape.security.x509.GeneralNameInterface gn)  
      java.lang.String toHexString​(byte[] data)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
      • GN_DIRECTORY_NAME

        public static final java.lang.String GN_DIRECTORY_NAME
        See Also:
        Constant Field Values
      • mConfigNames

        protected java.util.Vector<java.lang.String> mConfigNames
      • mValueNames

        protected java.util.Vector<java.lang.String> mValueNames
    • Constructor Detail

      • EnrollDefault

        public EnrollDefault()
    • Method Detail

      • getConfigNames

        public java.util.Enumeration<java.lang.String> getConfigNames()
        Description copied from interface: IConfigTemplate
        Returns a list of configuration parameter names.
        Returns:
        parameter names
      • getConfigDescriptor

        public IDescriptor getConfigDescriptor​(java.util.Locale locale,
                                               java.lang.String name)
        Description copied from interface: IConfigTemplate
        Returns the descriptors of configuration parameter.
        Parameters:
        locale - user locale
        name - configuration parameter name
        Returns:
        descriptor
      • addConfigName

        public void addConfigName​(java.lang.String name)
      • setConfig

        public void setConfig​(java.lang.String name,
                              java.lang.String value)
                       throws EPropertyException
        Description copied from interface: IConfigTemplate
        Sets configuration parameter.
        Parameters:
        name - parameter name
        value - parameter value
        Throws:
        EPropertyException - failed to set parameter
      • getConfig

        public java.lang.String getConfig​(java.lang.String name)
        Description copied from interface: IConfigTemplate
        Retrieves configuration parameter by name.
        Returns:
        parameter
      • getConfig

        public java.lang.String getConfig​(java.lang.String name,
                                          java.lang.String defval)
        Get constraint parameter in profile configuration.
        Parameters:
        name - parameter name
        defval - default value if parameter does not exist
        Returns:
        parameter value if exists, defval if does not exist, or null if error occured
      • getText

        public abstract java.lang.String getText​(java.util.Locale locale)
        Retrieves the localizable description of this policy.
        Specified by:
        getText in class PolicyDefault
        Parameters:
        locale - locale of the end user
        Returns:
        localized description of this default policy
      • getName

        public java.lang.String getName​(java.util.Locale locale)
        Description copied from class: PolicyDefault
        Retrieves the localizable name of this policy.
        Specified by:
        getName in class PolicyDefault
        Parameters:
        locale - locale of the end user
        Returns:
        localized name of this default policy
      • populate

        public abstract void populate​(IRequest request,
                                      org.mozilla.jss.netscape.security.x509.X509CertInfo info)
                               throws EProfileException
        Populates attributes into the certificate template.
        Parameters:
        request - enrollment request
        info - certificate template
        Throws:
        EProfileException - failed to populate attributes into request
      • setValue

        public abstract void setValue​(java.lang.String name,
                                      java.util.Locale locale,
                                      org.mozilla.jss.netscape.security.x509.X509CertInfo info,
                                      java.lang.String value)
                               throws EPropertyException
        Sets values from the approval page into certificate template.
        Parameters:
        name - name of the attribute
        locale - user locale
        info - certificate template
        value - attribute value
        Throws:
        EProfileException - failed to set attributes into request
        EPropertyException
      • getValue

        public abstract java.lang.String getValue​(java.lang.String name,
                                                  java.util.Locale locale,
                                                  org.mozilla.jss.netscape.security.x509.X509CertInfo info)
                                           throws EPropertyException
        Retrieves certificate template values and returns them to the approval page.
        Parameters:
        name - name of the attribute
        locale - user locale
        info - certificate template
        Throws:
        EProfileException - failed to get attributes from request
        EPropertyException
      • populate

        public void populate​(IRequest request)
                      throws EProfileException
        Populates the request with this policy default. The current implementation extracts enrollment specific attributes and calls the populate() method of the subclass.
        Specified by:
        populate in class PolicyDefault
        Parameters:
        request - request to be populated
        Throws:
        EProfileException - failed to populate
      • addValueName

        public void addValueName​(java.lang.String name)
      • getValueNames

        public java.util.Enumeration<java.lang.String> getValueNames()
        Description copied from class: PolicyDefault
        Retrieves a list of names of the property.
        Specified by:
        getValueNames in class PolicyDefault
        Returns:
        a list of property names. The values are of type java.lang.String
      • getValueDescriptor

        public IDescriptor getValueDescriptor​(java.lang.String name)
      • setValue

        public void setValue​(java.lang.String name,
                             java.util.Locale locale,
                             IRequest request,
                             java.lang.String value)
                      throws EPropertyException
        Sets the value of the given value property by name. The current implementation extracts enrollment specific attributes and calls the setValue() method of the subclass.
        Specified by:
        setValue in class PolicyDefault
        Parameters:
        name - name of property
        locale - locale of the end user
        request - request
        value - value to be set in the given request
        Throws:
        EPropertyException - failed to set property
      • getValue

        public java.lang.String getValue​(java.lang.String name,
                                         java.util.Locale locale,
                                         IRequest request)
                                  throws EPropertyException
        Retrieves the value of the given value property by name. The current implementation extracts enrollment specific attributes and calls the getValue() method of the subclass.
        Specified by:
        getValue in class PolicyDefault
        Parameters:
        name - name of property
        locale - locale of the end user
        request - request
        Throws:
        EPropertyException - failed to get property
      • toHexString

        public java.lang.String toHexString​(byte[] data)
      • refreshConfigAndValueNames

        protected void refreshConfigAndValueNames()
      • deleteExtension

        protected void deleteExtension​(java.lang.String extID,
                                       org.mozilla.jss.netscape.security.x509.X509CertInfo info)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getExtension

        protected org.mozilla.jss.netscape.security.x509.Extension getExtension​(java.lang.String name,
                                                                                org.mozilla.jss.netscape.security.x509.X509CertInfo info)
      • getExtension

        protected org.mozilla.jss.netscape.security.x509.Extension getExtension​(java.lang.String name,
                                                                                org.mozilla.jss.netscape.security.x509.CertificateExtensions exts)
      • addExtension

        protected void addExtension​(java.lang.String name,
                                    org.mozilla.jss.netscape.security.x509.Extension ext,
                                    org.mozilla.jss.netscape.security.x509.X509CertInfo info)
                             throws EProfileException
        Throws:
        EProfileException
      • replaceExtension

        protected void replaceExtension​(java.lang.String name,
                                        org.mozilla.jss.netscape.security.x509.Extension ext,
                                        org.mozilla.jss.netscape.security.x509.X509CertInfo info)
                                 throws EProfileException
        Throws:
        EProfileException
      • isOptional

        protected boolean isOptional​(java.lang.String value)
      • getBoolean

        protected boolean getBoolean​(java.lang.String value)
      • getInt

        protected int getInt​(java.lang.String value)
      • getConfigBoolean

        protected boolean getConfigBoolean​(java.lang.String value)
      • getConfigInt

        protected int getConfigInt​(java.lang.String value)
      • isGeneralNameValid

        protected boolean isGeneralNameValid​(java.lang.String name)
      • parseGeneralName

        protected org.mozilla.jss.netscape.security.x509.GeneralNameInterface parseGeneralName​(java.lang.String name)
                                                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • isGeneralNameType

        protected boolean isGeneralNameType​(java.lang.String nameType)
      • parseGeneralName

        protected org.mozilla.jss.netscape.security.x509.GeneralNameInterface parseGeneralName​(java.lang.String nameType,
                                                                                               java.lang.String nameValue)
                                                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getBytes

        public byte[] getBytes​(java.lang.String string)
        Converts string containing pairs of characters in the range of '0' to '9', 'a' to 'f' to an array of bytes such that each pair of characters in the string represents an individual byte
      • isValidOID

        public boolean isValidOID​(java.lang.String oid)
        Check if a object identifier in string form is valid, that is a string in the form n.n.n.n and der encode and decode-able.
        Parameters:
        oid - object identifier string.
        Returns:
        true if the oid is valid
      • buildRecords

        protected static java.lang.String buildRecords​(java.util.Vector<NameValuePairs> recs)
      • getGeneralNameType

        protected static java.lang.String getGeneralNameType​(org.mozilla.jss.netscape.security.x509.GeneralName gn)
                                                      throws EPropertyException
        Throws:
        EPropertyException
      • getGeneralNameValue

        protected static java.lang.String getGeneralNameValue​(org.mozilla.jss.netscape.security.x509.GeneralName gn)
                                                       throws EPropertyException
        Throws:
        EPropertyException
      • getLocale

        public java.util.Locale getLocale​(IRequest request)
      • toGeneralNameString

        public java.lang.String toGeneralNameString​(org.mozilla.jss.netscape.security.x509.GeneralNameInterface gn)
      • mapPattern

        protected java.lang.String mapPattern​(IRequest request,
                                              java.lang.String pattern)
                                       throws java.io.IOException
        Throws:
        java.io.IOException