com.netscape.cms.profile.def
Class SubjectAltNameExtDefault

java.lang.Object
  extended by com.netscape.cms.profile.def.EnrollDefault
      extended by com.netscape.cms.profile.def.EnrollExtDefault
          extended by com.netscape.cms.profile.def.SubjectAltNameExtDefault
All Implemented Interfaces:
ICertInfoPolicyDefault, IPolicyDefault, IConfigTemplate

public class SubjectAltNameExtDefault
extends EnrollExtDefault

This class implements an enrollment default policy that populates a subject alternative name extension into the certificate template.

Version:
$Revision: 1520 $, $Date: 2010-11-17 11:52:43 -0800 (Wed, 17 Nov 2010) $

Field Summary
static java.lang.String CONFIG_CRITICAL
           
static java.lang.String CONFIG_GN_ENABLE
           
static java.lang.String CONFIG_NUM_GNS
           
static java.lang.String CONFIG_OLD_PATTERN
           
static java.lang.String CONFIG_OLD_TYPE
           
static java.lang.String CONFIG_PATTERN
           
static java.lang.String CONFIG_SOURCE
           
static java.lang.String CONFIG_SOURCE_UUID4
           
static java.lang.String CONFIG_TYPE
           
static java.lang.String VAL_CRITICAL
           
static java.lang.String VAL_GENERAL_NAMES
           
 
Fields inherited from class com.netscape.cms.profile.def.EnrollDefault
GN_ANY_NAME, GN_DIRECTORY_NAME, GN_DNS_NAME, GN_EDI_NAME, GN_IP_NAME, GN_OID_NAME, GN_RFC822_NAME, GN_URI_NAME, mConfig, mConfigNames, mValueNames, PROP_NAME
 
Constructor Summary
SubjectAltNameExtDefault()
           
 
Method Summary
 netscape.security.x509.SubjectAlternativeNameExtension createExtension(IRequest request)
           
 IDescriptor getConfigDescriptor(java.util.Locale locale, java.lang.String name)
          Returns the descriptors of configuration parameter.
 java.util.Enumeration getConfigNames()
          Returns a list of configuration parameter names.
protected  int getNumGNs()
           
 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, netscape.security.x509.X509CertInfo info)
          Retrieves certificate template values and returns them to the approval page.
 IDescriptor getValueDescriptor(java.util.Locale locale, java.lang.String name)
          Retrieves the descriptor of the given property by name.
 void init(IProfile profile, IConfigStore config)
          Initializes this default policy.
 java.lang.String mapPattern(IRequest request, java.lang.String pattern)
           
 java.lang.String mapPattern(java.lang.String val, IRequest request, java.lang.String pattern)
           
 void populate(IRequest request, netscape.security.x509.X509CertInfo info)
          Populates the request with this policy default.
protected  void refreshConfigAndValueNames()
           
 void setConfig(java.lang.String name, java.lang.String value)
          Sets configuration parameter.
 void setValue(java.lang.String name, java.util.Locale locale, netscape.security.x509.X509CertInfo info, java.lang.String value)
          Sets values from the approval page into certificate template.
 
Methods inherited from class com.netscape.cms.profile.def.EnrollDefault
addConfigName, addExtension, addValueName, buildRecords, deleteExtension, escapeValueRfc1779, getBoolean, getBytes, getConfig, getConfigBoolean, getConfigInt, getConfigStore, getExtension, getExtension, getGeneralNameType, getGeneralNameValue, getInt, getLocale, getName, getValue, getValueDescriptor, getValueNames, isGeneralNameType, isGeneralNameValid, isOptional, isValidOID, parseGeneralName, parseGeneralName, parseRecords, populate, replaceExtension, setValue, toGeneralNameString, toHexString
 
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_NUM_GNS

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

CONFIG_GN_ENABLE

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

CONFIG_TYPE

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

CONFIG_PATTERN

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

CONFIG_SOURCE

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

CONFIG_SOURCE_UUID4

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

CONFIG_OLD_TYPE

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

CONFIG_OLD_PATTERN

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

VAL_CRITICAL

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

VAL_GENERAL_NAMES

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

SubjectAltNameExtDefault

public SubjectAltNameExtDefault()
Method Detail

getNumGNs

protected int getNumGNs()

init

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

Specified by:
init in interface IPolicyDefault
Overrides:
init in class EnrollDefault
Parameters:
profile - owner of this default policy
config - configuration store for this default
Throws:
EProfileException - failed to initialize

setConfig

public void setConfig(java.lang.String name,
                      java.lang.String value)
               throws EPropertyException
Description copied from interface: IConfigTemplate
Sets configuration parameter.

Specified by:
setConfig in interface IConfigTemplate
Overrides:
setConfig in class EnrollDefault
Parameters:
name - parameter name
value - parameter value
Throws:
EPropertyException - failed to set parameter

getConfigNames

public java.util.Enumeration getConfigNames()
Description copied from interface: IConfigTemplate
Returns a list of configuration parameter names.

Specified by:
getConfigNames in interface IConfigTemplate
Overrides:
getConfigNames in class EnrollDefault
Returns:
parameter names

refreshConfigAndValueNames

protected void refreshConfigAndValueNames()
Overrides:
refreshConfigAndValueNames in class EnrollDefault

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 EnrollDefault
Parameters:
locale - user locale
name - configuration parameter name
Returns:
descriptor

getValueDescriptor

public IDescriptor getValueDescriptor(java.util.Locale locale,
                                      java.lang.String name)
Description copied from interface: IPolicyDefault
Retrieves the descriptor of the given property by name. The descriptor contains syntax information.

Parameters:
locale - locale of the end user
name - name of property
Returns:
descriptor of the property

setValue

public void setValue(java.lang.String name,
                     java.util.Locale locale,
                     netscape.security.x509.X509CertInfo info,
                     java.lang.String value)
              throws EPropertyException
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
Throws:
EPropertyException

getValue

public java.lang.String getValue(java.lang.String name,
                                 java.util.Locale locale,
                                 netscape.security.x509.X509CertInfo info)
                          throws EPropertyException
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
Throws:
EPropertyException

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 interface IPolicyDefault
Specified by:
getText in class EnrollDefault
Parameters:
locale - locale of the end user
Returns:
localized description of this default policy

populate

public void populate(IRequest request,
                     netscape.security.x509.X509CertInfo info)
              throws EProfileException
Populates the request with this policy default.

Specified by:
populate in interface ICertInfoPolicyDefault
Specified by:
populate in class EnrollDefault
Parameters:
request - enrollment request
info - certificate template
Throws:
EProfileException - failed to populate attributes into request

createExtension

public netscape.security.x509.SubjectAlternativeNameExtension createExtension(IRequest request)
                                                                       throws java.io.IOException
Throws:
java.io.IOException

mapPattern

public java.lang.String mapPattern(IRequest request,
                                   java.lang.String pattern)
                            throws java.io.IOException
Overrides:
mapPattern in class EnrollDefault
Throws:
java.io.IOException

mapPattern

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