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

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • 18
    • Affects Version/s: 7
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: