JDK-6569580 : Need to find a place for all constants used in Sun security providers
  • Type: Enhancement
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 7
  • Priority: P5
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2007-06-14
  • Updated: 2014-12-11
  • Resolved: 2014-12-11
Related Reports
Relates :  
Description
Constant values, such as default keysizes for private keys and secret keys, are hardcoded in various places of many source files. This makes it difficult to maintain them in a consistent and manageable way. It's also difficult to synchronize the documentation and the implementation.

This issue becomes more annoying when we try to increase the default keysize for all RSA keypair generators due to the weakness of current standard. Since multiple providers include this function and each has its own default keysize hardcoded somewhere by different code writers, it's very easy to miss one.

This RFE attempts to add a sun.security.providers.Constants class to hold constants used in all Sun JDK security providers. The scope of what constants need to be extracted and the format of the names are yet to be decided.

Comments
EVALUATION First I'd like to add all numberic constants appeared in the "Sun Providers Documentation". The name format will look like ALGTYPE_ALGNAME_PROVIDER_VALUENAME_CONSTTYPE (say KEYPAIRGENERATOR_RSA_SUN_KEYSIZE_DEFAULT). If several related items have the same value, they can be grouped together like: _DSA_SUN_KEYSIZE_DEFAULT = 1024 KEYPAIRGENERATOR_DSA_SUN_KEYSIZE_DEFAULT = _DSA_SUN_KEYSIZE_DEFAULT ALGORITHMPARAMETERGENERATOR_DSA_SUN_KEYSIZE_DEFAULT = _DSA_SUN_KEYSIZE_DEFAULT
14-06-2007