JDK-8207318 : KeyStore#getInstance(File, LoadStoreParameter) does not load the keystore
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 10,11
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-07-15
  • Updated: 2018-08-17
  • Resolved: 2018-07-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12
11 b23Fixed 12Fixed
Related Reports
Relates :  
Description
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)


Comments
Verified using JDK 11 b26 and JCK 11 b12. attaching passed logs (index_GetInstance2Tests.jtr)
17-08-2018