JDK-8130850 : Support loading a keystore with a custom KeyStore.LoadStoreParameter class
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-07-09
  • Updated: 2018-01-11
  • Resolved: 2015-07-31
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 9
9 b77Fixed
Related Reports
Relates :  
Description
The KeyStore.load method supports loading a keystore with a KeyStore.LoadStoreParameter that encapsulates the keystore password.

Currently, supplying a custom LoadStoreParameter class results in an UnsupportedOperationException.
For example, supplying the following custom class should not throw an exception:


    static class MyLoadStoreParameter implements KeyStore.LoadStoreParameter {
        private KeyStore.ProtectionParameter protection;

        MyLoadStoreParameter (KeyStore.ProtectionParameter protection) {
            this.protection = protection;
        }

        public KeyStore.ProtectionParameter getProtectionParameter() {
            return protection;
        }
    }

      :
    myKeystore.load(new MyLoadStoreParameter(
        new KeyStore.PasswordProtection(KEYSTORE_PASSWORD));