use of de.carne.jfx.util.validation.ValidationException in project certmgr by hdecarne.
the class CertImportController method validateAndReloadFileSource.
private void validateAndReloadFileSource() {
try {
Path fileSource = validateFileSourceInput();
getExecutorService().submit(new ReloadTask<Path>(fileSource) {
@Override
protected UserCertStore createStore(Path params) throws IOException {
return UserCertStore.createFromFile(params, PasswordDialog.enterPassword(CertImportController.this));
}
});
} catch (ValidationException e) {
ValidationAlerts.error(e).showAndWait();
}
}
use of de.carne.jfx.util.validation.ValidationException in project certmgr by hdecarne.
the class CRLOptionsController method onCmdUpdate.
@SuppressWarnings("unused")
@FXML
void onCmdUpdate(ActionEvent evt) {
try {
UpdateCRLRequest updateRequest = validateAndGetUpdateRequest();
getExecutorService().submit(new UpdateCRLTask(updateRequest));
} catch (ValidationException e) {
ValidationAlerts.error(e).showAndWait();
}
}
use of de.carne.jfx.util.validation.ValidationException in project certmgr by hdecarne.
the class DNEditorController method validateAndGetDN.
private X500Principal validateAndGetDN() throws ValidationException {
LdapName ldapDN = new LdapName(this.ctlRdnEntries.getItems());
X500Principal x500DN;
try {
x500DN = X500Names.fromString(ldapDN.toString());
} catch (IllegalArgumentException e) {
throw new ValidationException(DNEditorI18N.formatSTR_MESSAGE_INVALID_DN(e.getLocalizedMessage()), e);
}
return x500DN;
}
use of de.carne.jfx.util.validation.ValidationException in project certmgr by hdecarne.
the class StorePreferencesController method onApply.
private void onApply(ActionEvent evt) {
if (!this.storeParam.toOptional().isPresent()) {
try {
Path storeHome = validateStoreHomeInput();
this.storeParam.set(UserCertStore.createStore(storeHome));
this.storePreferencesParam.set(Check.notNull(this.storeParam.get().storePreferences()));
} catch (ValidationException e) {
ValidationAlerts.error(e).showAndWait();
evt.consume();
} catch (Exception e) {
Alerts.unexpected(e).showAndWait();
evt.consume();
}
}
if (this.storePreferencesParam.toOptional().isPresent()) {
try {
UserCertStorePreferences storePreferences = this.storePreferencesParam.get();
storePreferences.defaultCRTValidityPeriod.put(validateDefCRTValidityInput().days().count());
storePreferences.defaultCRLUpdatePeriod.put(validateDefCRLUpdateInput().days().count());
storePreferences.defaultKeyPairAlgorithm.put(validateDefKeyAlgInput().algorithm());
storePreferences.defaultKeySize.put(validateDefKeySizeInput());
storePreferences.defaultSignatureAlgorithm.put(validateDefSigAlgInput().algorithm());
storePreferences.sync();
} catch (ValidationException e) {
ValidationAlerts.error(e).showAndWait();
evt.consume();
} catch (Exception e) {
Alerts.unexpected(e).showAndWait();
evt.consume();
}
}
}
use of de.carne.jfx.util.validation.ValidationException in project certmgr by hdecarne.
the class CRLDistributionPointsController method onApply.
private void onApply(ActionEvent evt) {
try {
boolean critical = this.ctlCritical.isSelected();
DistributionPoint distributionPoint = validateAndGetDistributionPoint();
this.extensionDataResult = new CRLDistributionPointsExtensionData(critical);
this.extensionDataResult.addDistributionPoint(distributionPoint);
} catch (ValidationException e) {
ValidationAlerts.error(e).showAndWait();
evt.consume();
}
}
Aggregations