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

entries.remove(entry) is useless in PKCS12KeyStore

    XMLWordPrintable

Details

    Backports

      Description

        Before password-less PKCS12 keystores are supported, certificates in a PKCS12 file are always encrypted. Therefore if one loads the keystore with a null pass, it contains `PrivateKeyEntry`s without certificates. When JDK-8076190 introduced the password-less feature I also added a line to remove such an entry.

        https://github.com/openjdk/jdk/blob/a729a70c0119ed071ff490b0dfd4e3e2cb1a5ae4/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java#L2272

        Unfortunately, the line is not coded correctly, it should have been `remove(key)` but here it's `remove(value)`.

        Attachments

          Issue Links

            Activity

              People

                weijun Weijun Wang
                weijun Weijun Wang
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: