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

KeyStore#getInstance(File, LoadStoreParameter) does not load the keystore

XMLWordPrintable

    • b41
    • 10
    • b23
    • Verified

        Specification of KeyStore#getInstance(File, LoadStoreParameter) :

        "Returns a loaded keystore object of the appropriate keystore type.
        First the keystore type is determined by probing the specified file.
        Then a keystore object is instantiated and loaded using the data from
        that file."

        As per above statement, the KeyStore should be instantiated and loaded, so that the methods like (size, getCreationData(String), getCertificate(String) , etc) could be directly called without "loading" again (i.e. a call to load method is not needed)

        However the behavior noticed is that when "load" method is not called explicitly then invoking any methods that needs the KeyStore object to be loaded before they are called fails with

        >java.security.KeyStoreException: Uninitialized keystore
        >at java.base/java.security.KeyStore.getCreationDate(KeyStore.java:1133)

              weijun Weijun Wang
              bnallakaluva Bharath Nallakaluva (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: