public class KeyConstraint extends EnrollConstraint
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_KEY_PARAMETERS |
static java.lang.String |
CONFIG_KEY_TYPE |
CONFIG_NAME, mConfig, mConfigNames
Constructor and Description |
---|
KeyConstraint() |
Modifier and Type | Method and Description |
---|---|
IDescriptor |
getConfigDescriptor(java.util.Locale locale,
java.lang.String name)
Returns the descriptors of configuration parameter.
|
int |
getDSAKeyLen(netscape.security.x509.X509Key key) |
int |
getRSAKeyLen(netscape.security.x509.X509Key key) |
java.lang.String |
getText(java.util.Locale locale)
Returns localized description of this constraint.
|
void |
init(IProfile profile,
IConfigStore config)
Initializes this constraint policy.
|
boolean |
isApplicable(IPolicyDefault def)
Checks if this constraint is applicable to the
given default policy.
|
void |
setConfig(java.lang.String name,
java.lang.String value)
Sets configuration parameter.
|
void |
validate(IRequest request,
netscape.security.x509.X509CertInfo info)
Validates the request.
|
addConfigName, getBoolean, getConfig, getConfigBoolean, getConfigInt, getConfigNames, getConfigStore, getExtension, getInt, getLocale, getName, getValueDescriptor, isOptional, validate
public static final java.lang.String CONFIG_KEY_TYPE
public static final java.lang.String CONFIG_KEY_PARAMETERS
public void init(IProfile profile, IConfigStore config) throws EProfileException
IPolicyConstraint
init
in interface IPolicyConstraint
init
in class EnrollConstraint
profile
- owner of this policyconfig
- configuration store for this constraintEProfileException
- failed to initializepublic IDescriptor getConfigDescriptor(java.util.Locale locale, java.lang.String name)
IConfigTemplate
getConfigDescriptor
in interface IConfigTemplate
getConfigDescriptor
in class EnrollConstraint
locale
- user localename
- configuration parameter namepublic void validate(IRequest request, netscape.security.x509.X509CertInfo info) throws ERejectException
validate
in class EnrollConstraint
request
- enrollment requestinfo
- certificate templateERejectException
- request is rejected due
to violation of constraintpublic int getRSAKeyLen(netscape.security.x509.X509Key key) throws java.lang.Exception
java.lang.Exception
public int getDSAKeyLen(netscape.security.x509.X509Key key) throws java.lang.Exception
java.lang.Exception
public java.lang.String getText(java.util.Locale locale)
IPolicyConstraint
getText
in interface IPolicyConstraint
getText
in class EnrollConstraint
locale
- locale of the end-userpublic boolean isApplicable(IPolicyDefault def)
IPolicyConstraint
isApplicable
in interface IPolicyConstraint
isApplicable
in class EnrollConstraint
def
- default policy to be checkedpublic void setConfig(java.lang.String name, java.lang.String value) throws EPropertyException
IConfigTemplate
setConfig
in interface IConfigTemplate
setConfig
in class EnrollConstraint
name
- parameter namevalue
- parameter valueEPropertyException
- failed to set parameter