Package com.netscape.cms.profile.def
Class EnrollDefault
- java.lang.Object
-
- com.netscape.cms.profile.def.EnrollDefault
-
- All Implemented Interfaces:
ICertInfoPolicyDefault,IPolicyDefault,IConfigTemplate
- Direct Known Subclasses:
AuthTokenSubjectNameDefault,AuthzRealmDefault,AutoAssignDefault,CAEnrollDefault,CAValidityDefault,CMCUserSignedSubjectNameDefault,EnrollExtDefault,ImageDefault,nsHKeySubjectNameDefault,nsNKeySubjectNameDefault,nsTokenDeviceKeySubjectNameDefault,nsTokenUserKeySubjectNameDefault,RandomizedValidityDefault,SigningAlgDefault,SubjectNameDefault,UserKeyDefault,UserSigningAlgDefault,UserSubjectNameDefault,UserValidityDefault,ValidityDefault
public abstract class EnrollDefault extends java.lang.Object implements IPolicyDefault, ICertInfoPolicyDefault
This class implements an enrollment default policy.- Version:
- $Revision$, $Date$
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGN_ANY_NAMEstatic java.lang.StringGN_DIRECTORY_NAMEstatic java.lang.StringGN_DNS_NAMEstatic java.lang.StringGN_EDI_NAMEstatic java.lang.StringGN_IP_NAMEstatic java.lang.StringGN_OID_NAMEstatic java.lang.StringGN_RFC822_NAMEstatic java.lang.StringGN_URI_NAMEprotected IConfigStoremConfigprotected java.util.Vector<java.lang.String>mConfigNamesprotected java.util.Vector<java.lang.String>mValueNamesstatic java.lang.StringPROP_NAME
-
Constructor Summary
Constructors Constructor Description EnrollDefault()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddConfigName(java.lang.String name)protected voidaddExtension(java.lang.String name, Extension ext, X509CertInfo info)voidaddValueName(java.lang.String name)protected static java.lang.StringbuildRecords(java.util.Vector<NameValuePairs> recs)protected voiddeleteExtension(java.lang.String name, X509CertInfo info)protected booleangetBoolean(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 bytejava.lang.StringgetConfig(java.lang.String name)Retrieves configuration parameter by name.java.lang.StringgetConfig(java.lang.String name, java.lang.String defval)Get constraint parameter in profile configuration.protected booleangetConfigBoolean(java.lang.String value)IDescriptorgetConfigDescriptor(java.util.Locale locale, java.lang.String name)Returns the descriptors of configuration parameter.protected intgetConfigInt(java.lang.String value)java.util.Enumeration<java.lang.String>getConfigNames()Returns a list of configuration parameter names.IConfigStoregetConfigStore()Retrieves the configuration store of this default.protected ExtensiongetExtension(java.lang.String name, CertificateExtensions exts)protected ExtensiongetExtension(java.lang.String name, X509CertInfo info)protected static java.lang.StringgetGeneralNameType(GeneralName gn)protected static java.lang.StringgetGeneralNameValue(GeneralName gn)protected intgetInt(java.lang.String value)java.util.LocalegetLocale(IRequest request)java.lang.StringgetName(java.util.Locale locale)Retrieves the localizable name of this policy.abstract java.lang.StringgetText(java.util.Locale locale)Retrieves the localizable description of this policy.java.lang.StringgetValue(java.lang.String name, java.util.Locale locale, IRequest request)Retrieves the value of the given value property by name.abstract java.lang.StringgetValue(java.lang.String name, java.util.Locale locale, X509CertInfo info)Retrieves certificate template values and returns them to the approval page.IDescriptorgetValueDescriptor(java.lang.String name)java.util.Enumeration<java.lang.String>getValueNames()Retrieves a list of names of the property.voidinit(IProfile profile, IConfigStore config)Initializes this default policy.protected booleanisGeneralNameType(java.lang.String nameType)protected booleanisGeneralNameValid(java.lang.String name)protected booleanisOptional(java.lang.String value)booleanisValidOID(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.StringmapPattern(IRequest request, java.lang.String pattern)protected GeneralNameInterfaceparseGeneralName(java.lang.String name)protected GeneralNameInterfaceparseGeneralName(java.lang.String nameType, java.lang.String nameValue)protected java.util.Vector<NameValuePairs>parseRecords(java.lang.String value)voidpopulate(IRequest request)Populates the request with this policy default.abstract voidpopulate(IRequest request, X509CertInfo info)Populates attributes into the certificate template.protected voidrefreshConfigAndValueNames()protected voidreplaceExtension(java.lang.String name, Extension ext, X509CertInfo info)voidsetConfig(java.lang.String name, java.lang.String value)Sets configuration parameter.voidsetValue(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 voidsetValue(java.lang.String name, java.util.Locale locale, X509CertInfo info, java.lang.String value)Sets values from the approval page into certificate template.java.lang.StringtoGeneralNameString(GeneralNameInterface gn)java.lang.StringtoHexString(byte[] data)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.netscape.certsrv.profile.IPolicyDefault
getValueDescriptor
-
-
-
-
Field Detail
-
PROP_NAME
public static final java.lang.String PROP_NAME
- See Also:
- Constant Field Values
-
GN_RFC822_NAME
public static final java.lang.String GN_RFC822_NAME
- See Also:
- Constant Field Values
-
GN_DNS_NAME
public static final java.lang.String GN_DNS_NAME
- See Also:
- Constant Field Values
-
GN_URI_NAME
public static final java.lang.String GN_URI_NAME
- See Also:
- Constant Field Values
-
GN_IP_NAME
public static final java.lang.String GN_IP_NAME
- See Also:
- Constant Field Values
-
GN_DIRECTORY_NAME
public static final java.lang.String GN_DIRECTORY_NAME
- See Also:
- Constant Field Values
-
GN_EDI_NAME
public static final java.lang.String GN_EDI_NAME
- See Also:
- Constant Field Values
-
GN_ANY_NAME
public static final java.lang.String GN_ANY_NAME
- See Also:
- Constant Field Values
-
GN_OID_NAME
public static final java.lang.String GN_OID_NAME
- See Also:
- Constant Field Values
-
mConfig
protected IConfigStore mConfig
-
mConfigNames
protected java.util.Vector<java.lang.String> mConfigNames
-
mValueNames
protected java.util.Vector<java.lang.String> mValueNames
-
-
Method Detail
-
getConfigNames
public java.util.Enumeration<java.lang.String> getConfigNames()
Description copied from interface:IConfigTemplateReturns a list of configuration parameter names.- Specified by:
getConfigNamesin interfaceIConfigTemplate- Returns:
- parameter names
-
getConfigDescriptor
public IDescriptor getConfigDescriptor(java.util.Locale locale, java.lang.String name)
Description copied from interface:IConfigTemplateReturns the descriptors of configuration parameter.- Specified by:
getConfigDescriptorin interfaceIConfigTemplate- Parameters:
locale- user localename- 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 EPropertyExceptionDescription copied from interface:IConfigTemplateSets configuration parameter.- Specified by:
setConfigin interfaceIConfigTemplate- Parameters:
name- parameter namevalue- parameter value- Throws:
EPropertyException- failed to set parameter
-
getConfig
public java.lang.String getConfig(java.lang.String name)
Description copied from interface:IConfigTemplateRetrieves configuration parameter by name.- Specified by:
getConfigin interfaceIConfigTemplate- 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 namedefval- default value if parameter does not exist- Returns:
- parameter value if exists, defval if does not exist, or null if error occured
-
init
public void init(IProfile profile, IConfigStore config) throws EProfileException
Description copied from interface:IPolicyDefaultInitializes this default policy.- Specified by:
initin interfaceIPolicyDefault- Parameters:
profile- owner of this default policyconfig- configuration store for this default- Throws:
EProfileException- failed to initialize
-
getText
public abstract java.lang.String getText(java.util.Locale locale)
Retrieves the localizable description of this policy.- Specified by:
getTextin interfaceIPolicyDefault- Parameters:
locale- locale of the end user- Returns:
- localized description of this default policy
-
getConfigStore
public IConfigStore getConfigStore()
Description copied from interface:IPolicyDefaultRetrieves the configuration store of this default.- Specified by:
getConfigStorein interfaceIPolicyDefault- Returns:
- configuration store of this default policy
-
getName
public java.lang.String getName(java.util.Locale locale)
Description copied from interface:IPolicyDefaultRetrieves the localizable name of this policy.- Specified by:
getNamein interfaceIPolicyDefault- Parameters:
locale- locale of the end user- Returns:
- localized name of this default policy
-
populate
public abstract void populate(IRequest request, X509CertInfo info) throws EProfileException
Populates attributes into the certificate template.- Specified by:
populatein interfaceICertInfoPolicyDefault- Parameters:
request- enrollment requestinfo- certificate template- Throws:
EProfileException- failed to populate attributes into request
-
setValue
public abstract void setValue(java.lang.String name, java.util.Locale locale, X509CertInfo info, java.lang.String value) throws EPropertyExceptionSets values from the approval page into certificate template.- Parameters:
name- name of the attributelocale- user localeinfo- certificate templatevalue- attribute value- Throws:
EProfileException- failed to set attributes into requestEPropertyException
-
getValue
public abstract java.lang.String getValue(java.lang.String name, java.util.Locale locale, X509CertInfo info) throws EPropertyExceptionRetrieves certificate template values and returns them to the approval page.- Parameters:
name- name of the attributelocale- user localeinfo- certificate template- Throws:
EProfileException- failed to get attributes from requestEPropertyException
-
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:
populatein interfaceIPolicyDefault- 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 interface:IPolicyDefaultRetrieves a list of names of the property.- Specified by:
getValueNamesin interfaceIPolicyDefault- 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 EPropertyExceptionSets 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:
setValuein interfaceIPolicyDefault- Parameters:
name- name of propertylocale- locale of the end userrequest- requestvalue- 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 EPropertyExceptionRetrieves 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:
getValuein interfaceIPolicyDefault- Parameters:
name- name of propertylocale- locale of the end userrequest- 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 name, X509CertInfo info)
-
getExtension
protected Extension getExtension(java.lang.String name, X509CertInfo info)
-
getExtension
protected Extension getExtension(java.lang.String name, CertificateExtensions exts)
-
addExtension
protected void addExtension(java.lang.String name, Extension ext, X509CertInfo info) throws EProfileException- Throws:
EProfileException
-
replaceExtension
protected void replaceExtension(java.lang.String name, Extension ext, 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 GeneralNameInterface parseGeneralName(java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
isGeneralNameType
protected boolean isGeneralNameType(java.lang.String nameType)
-
parseGeneralName
protected 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)
-
parseRecords
protected java.util.Vector<NameValuePairs> parseRecords(java.lang.String value) throws EPropertyException
- Throws:
EPropertyException
-
getGeneralNameType
protected static java.lang.String getGeneralNameType(GeneralName gn) throws EPropertyException
- Throws:
EPropertyException
-
getGeneralNameValue
protected static java.lang.String getGeneralNameValue(GeneralName gn) throws EPropertyException
- Throws:
EPropertyException
-
getLocale
public java.util.Locale getLocale(IRequest request)
-
toGeneralNameString
public java.lang.String toGeneralNameString(GeneralNameInterface gn)
-
mapPattern
protected java.lang.String mapPattern(IRequest request, java.lang.String pattern) throws java.io.IOException
- Throws:
java.io.IOException
-
-