On Feb 3, 2006, at 1:31 PM, Raif S. Naffah wrote:

hello there,

this patch makes the keypair-generators wrapped in
gnu.java.security.jce.sig.KeyPairGeneratorAdapter extend the
java.security.KeyPairGenerator rather than KeyPairGeneratorSpi making
it possible for adapted classes to be cast to other specific
keypair-generators.

DSSKeyPairGeneratorSpi (in gnu/java.security.jce.sig) now implements the
java.security.interfaces.DSAKeyPairGenerator.


2006-02-04  Raif S. Naffah  <[EMAIL PROTECTED]>

        * gnu/java/security/jce/sig/DSSKeyPairGeneratorSpi.java: Implement
        DSAKeyPairGenerator.
        (initialize(int,SecureRandom)): Call initialize(keysize, false,
random).
(initialize(AlgorithmParameterSpec,SecureRandom)): More explicit error
        message.
        Surround call to adaptee in a try/catch.
        (initialize((DSAParams,SecureRandom)): New method.
        (initialize(int,boolean,SecureRandom)): New method.
        * gnu/java/security/jce/sig/KeyPairGeneratorAdapter.java: Extends
        KeyPairGenerator rather than KeyPairGeneratorSpi.
        (KeyPairGeneratorAdapter): Call super with algorithm name.

ok to commit?


Yes. Some of the style formatting like this:

@@ -96,9 +93,9 @@
     if (params != null)
       {
         if (!(params instanceof DSAParameterSpec))
-          {
-            throw new InvalidAlgorithmParameterException("params");
-          }
+          throw new InvalidAlgorithmParameterException(
+              "Parameters argument is not a non-null instance, or " +
+ "sub-instance, of java.security.spec.DSAParameterSpec");

         attributes.put(DSSKeyPairGenerator.DSS_PARAMETERS, params);
       }


Looks wrong to me; you usually break lines after `,' or `+' in long expressions like this, not after the `(' (Emacs will break the formatting here, and will indent the "Parameters.." line to line up with the opening parenthesis). In this case I think doing something like this is more appropriate:

  throw new InvalidAlgorithmParameterException
    ("Parameters argument is not a non-null instance, or " +
     "sub-instance, of java.security.spec.DSAParameterSpec");

Although I don't want to claim to be a GNU source formatting expert. But otherwise, I think you should feel free to check in any fixes like this, without approval.

Reply via email to