Class CommonNameToSANDefault

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

    public class CommonNameToSANDefault
    extends EnrollExtDefault
    This plugin will examine the most specific CN in the Subject DN, and if it looks like a DNS name, will add it to the SAN extension. It will create the SAN extension if necessary. If there is already a SAN dnsName value that matches (case-insensitively) the CN, it will not add the name. If there is no CN in the subject DN, does nothing. If the most specific CN does not look like a DNS name, does nothing. This profile component should be configured to execute after other profile components that set or modify the Subject DN or the SAN extension.
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
    • Constructor Detail

      • CommonNameToSANDefault

        public CommonNameToSANDefault()
    • Method Detail

      • populate

        public void populate​(com.netscape.certsrv.request.IRequest _req,
                             org.mozilla.jss.netscape.security.x509.X509CertInfo info)
                      throws com.netscape.certsrv.profile.EProfileException
        Description copied from class: EnrollDefault
        Populates attributes into the certificate template.
        Specified by:
        populate in class EnrollDefault
        Parameters:
        _req - enrollment request
        info - certificate template
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to populate attributes into request
      • getText

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

        public com.netscape.certsrv.property.IDescriptor getValueDescriptor​(java.util.Locale locale,
                                                                            java.lang.String name)
        Description copied from class: PolicyDefault
        Retrieves the descriptor of the given property by name. The descriptor contains syntax information.
        Specified by:
        getValueDescriptor in class PolicyDefault
        Parameters:
        locale - locale of the end user
        name - name of property
        Returns:
        descriptor of the property
      • getValue

        public java.lang.String getValue​(java.lang.String name,
                                         java.util.Locale locale,
                                         org.mozilla.jss.netscape.security.x509.X509CertInfo info)
        Description copied from class: EnrollDefault
        Retrieves certificate template values and returns them to the approval page.
        Specified by:
        getValue in class EnrollDefault
        Parameters:
        name - name of the attribute
        locale - user locale
        info - certificate template
      • setValue

        public void setValue​(java.lang.String name,
                             java.util.Locale locale,
                             org.mozilla.jss.netscape.security.x509.X509CertInfo info,
                             java.lang.String value)
        Description copied from class: EnrollDefault
        Sets values from the approval page into certificate template.
        Specified by:
        setValue in class EnrollDefault
        Parameters:
        name - name of the attribute
        locale - user locale
        info - certificate template
        value - attribute value
      • isValidDNSName

        public static boolean isValidDNSName​(java.lang.String s)
        Validate DNS name syntax per Section 3.5 of RFC 1034 and Section 2.1 of RFC 1123, and the additional rules of RFC 5280 Section 4.2.1.6. Further to those rules, we also ignore CNs that are valid DNS names but which only have a single part (e.g. TLDs or host short names).
      • isLetter

        public static boolean isLetter​(char c)
      • isDigit

        public static boolean isDigit​(char c)
      • isLetDig

        public static boolean isLetDig​(char c)
      • isLetDigHyp

        public static boolean isLetDigHyp​(char c)