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

Signature.getAlgorithm() returns wrong value

XMLWordPrintable

    • beta
    • sparc
    • solaris_2.6



      Name: asR10047 Date: 05/25/2000


      Signature.getAlgorithm() returns the value that is not
      specified as a standard name for digital signature algorithms
      in JCA. It happens only for SHA1withDSA algorithm of SUN provider
       
      Here is the example demonstrating the bug:
      ------------------ SignatureTest.java -----------------
      import java.security.*;

      public class SignatureTest {

          public static void main(String[] argv) {
              String alg = "SHA1withDSA";
              Signature sig = null;
              try {
                  sig = Signature.getInstance( alg, "SUN");
              } catch(NoSuchAlgorithmException nsae) {
                  System.out.println(nsae);
              } catch(NoSuchProviderException nspe) {
                  System.out.println(nspe);
              }
         
              System.out.println(" initialized with alorithm "+alg);
              System.out.println(" Signature.getAlgorithm() returns "+sig.getAlgorithm());
              System.exit(0);
          }
      }
      -------------- Output from the test -----------------
      java full version "1.3.0-C"
      Compiled...
       initialized with alorithm SHA1withDSA
       Signature.getAlgorithm() returns SHA/DSA
      ------------------------------------------------------

       In this case Signature.getAlgorithm() should return "SHA1withDSA"

      ======================================================================

            shihliu Sharon Liu (Inactive)
            anssunw Ans Ans (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: