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

SunMSCAPI provider KeyStore.aliases() returns non unique aliases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • security-libs

      FULL PRODUCT VERSION :


      ADDITIONAL OS VERSION INFORMATION :
      All Windows versions

      A DESCRIPTION OF THE PROBLEM :
      SunMSCAPI provider KeyStore.aliases() returns not unique aliases if we have two different certificates but this certificates have the same CN but different serial numbers

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Import to Windows-MY store two different certificates with the same CN but different serial number.
      Get aliases enumeration from store.
      Aliases are not unique.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      This code should return CN, issuer and serial number to uniquely identify certificates.
      ACTUAL -
      This code returns two times the same CN value which is not unique in this situation.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      KeyStore capi = KeyStore.getInstance("Windows-MY");
       capi.load(null, null);
              
       Enumeration<String> aliases = capi.aliases();
       while (aliases.hasMoreElements()) {
             String alias = (String) aliases.nextElement();
              System.out.println(alias);
      }
      ---------- END SOURCE ----------

            Unassigned Unassigned
            coffeys Sean Coffey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: