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