summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java41
1 files changed, 12 insertions, 29 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java
index 4b2499e6..37d11691 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java
@@ -530,48 +530,31 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase {
// Fall through
case 1:
try {
- loadKeystore();
+ if (config.keystoreStorePass != null) /* don't cause password prompts, just silently accept if there is no saved password */
+ loadKeystore();
} catch (Exception e) {
throw new CantLoadKeystoreException(e, 4); //skip next checks
}
// Fall through
case 2:
{
- String alias = config.keystoreAlias;
- if (!this.ks.containsAlias(alias))
- throw new KeystoreAliasDoesntExistException(alias, 4); //skip next check
- if (!this.ks.isKeyEntry(alias))
- throw new KeystoreAliasNoKeyException(alias, 4); //skip next check
+ if (this.ks != null)
+ {
+ String alias = config.keystoreAlias;
+ if (!this.ks.containsAlias(alias))
+ throw new KeystoreAliasDoesntExistException(alias, 4); //skip next check
+ if (!this.ks.isKeyEntry(alias))
+ throw new KeystoreAliasNoKeyException(alias, 4); //skip next check
+ }
}
// Fall through
case 3:
try {
String alias = config.keystoreAlias;
String keypass = config.keystoreKeyPass;
- if (keypass != null)
+ if ((this.ks != null) && (keypass != null))
{ /* if no keypass is specified, this will happen at signature time */
- Key key = null;
- while (key == null)
- {
- if (keypass == null)
- {
- keypass = new PasswordInputDialog(
- getShell(),
- Messages.getString("keystore_config.KeystoreKeyPass"),
- Messages.getString("keystore.KeystoreKeyPassEntry")).open();
-
- if (keypass == null)
- throw new UnrecoverableKeyException("User cancelled password input");
- }
-
- try {
- key = this.ks.getKey(alias, keypass.toCharArray());
- } catch (UnrecoverableKeyException ex) {
- new ErrorDialog(getShell(), Messages.getString("error.KeyStoreKeyPass"), BUTTONS.OK).open();
- keypass = null;
- }
- }
- config.keystoreKeyPass = keypass;
+ this.ks.getKey(alias, keypass.toCharArray());
}
} catch (Exception e) {
throw new KeystoreKeyPasswordException(4);