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

KeyStore.setEntry() cannot overwrite a PrivateKeyEntry with a TrustedCertificateEntry

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 18
    • 7
    • security-libs

      According to javadoc, KeyStore has different policies on entry overwriting:

        setCertificateEntry: only overwrite TrustedCertificateEntry, otherwise exception is thrown
        setKeyEntry, setEntry: always overwrite

      However, the implementation of engineSetEntry() in KeyStoreSpi calls engineSetCertificateEntry() when the entry is a TrustedCertificateEntry, therefore, if the existing entry is a PrivateKeyEntry, an exception is thrown.

      Implementation does not conform to spec.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: