Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4297026

RSA Keypair generation using java.security.spec.RSAKeyGenParameterSpec fails

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.4.0
    • 1.3.0
    • security-libs
    • beta
    • generic, sparc
    • generic, solaris_7



      Name: mc57594 Date: 12/05/99


      java version "1.3beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
      Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode)


      Using java.security.spec.RSAKeyGenParameterSpec as an argument to the built in
      RSA Keypair generator (e.g. kpg.initialize (spec)) fails with a
      InvalidAlgorithmParameterException - "Parameter spec not RSA key pair gen.".

      It looks like the com.sun.rsajca.JSA_RSAKeyPairGenerator is looking for the
      internal com.sun.rsajca.RSAGenParameterSpec rather than
      java.security.spec.RSAKeyGenParameterSpec.


      // Generate the RSA Key Pair

      // Using this will fail
      RSAKeyGenParameterSpec rsaSpec =
      new RSAKeyGenParameterSpec (1024, RSAKeyGenParameterSpec.F4);


      // This is com.sun.rsajca.RSAGenParameterSpec - this will succeed.

              // RSAGenParameterSpec rsaSpec =
      // new RSAGenParameterSpec (1024, RSAKeyGenParameterSpec.F4);

      KeyPairGenerator kpg = KeyPairGenerator.getInstance ("RSA",
      "SunRsaSign");

      kpg.initialize (rsaSpec);

      System.out.print ("Starting key pair generation....");
      KeyPair kp = kpg.generateKeyPair();
      (Review ID: 98216)
      ======================================================================
      sean.mullan@ireland 1999-12-22

      Adjusted priority from 4 to 5 to reflect the fact that this will be
      fixed after FCS.

            mullan Sean Mullan
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: