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

Support loading a keystore with a custom KeyStore.LoadStoreParameter class

XMLWordPrintable

    • b77
    • Verified

        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));

              vinnie Vincent Ryan
              vinnie Vincent Ryan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: