use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class CertImportController method validateAndReloadPlatformSource.
private void validateAndReloadPlatformSource() {
try {
PlatformKeyStore platformSource = validatePlatformSourceInput();
getExecutorService().submit(new ReloadTask<PlatformKeyStore>(platformSource) {
@Override
protected UserCertStore createStore(PlatformKeyStore params) throws IOException {
return UserCertStore.createFromPlatformKeyStore(params, PasswordDialog.enterPassword(CertImportController.this));
}
});
} catch (ValidationException e) {
ValidationAlerts.error(e).showAndWait();
}
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class CertImportController method importSelection.
void importSelection(Set<UserCertStoreEntry> importSelection) throws IOException {
PasswordCallback newPassword = PasswordDialog.enterNewPassword(this);
UserCertStore importStore = this.importStoreParam.get();
for (UserCertStoreEntry importEntry : importSelection) {
importStore.importEntry(importEntry, newPassword, CertImportI18N.formatSTR_TEXT_ALIASHINT());
}
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class CertImportController method updateImportEntryView.
private void updateImportEntryView() {
this.lazyImportEntryViewHelper.get().update(this.sourceStore);
UserCertStore checkedSourceStore = this.sourceStore;
if (checkedSourceStore != null) {
this.ctlStatusMessage.setText(CertImportI18N.formatSTR_STATUS_NEW_STORE(checkedSourceStore.size()));
this.ctlStatusImage.setImage(Images.OK16);
} else {
this.ctlStatusMessage.setText(CertImportI18N.formatSTR_STATUS_NO_STORE());
this.ctlStatusImage.setImage(Images.WARNING16);
}
this.ctlSelectAllOption.setSelected(false);
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class StoreController method onCmdNewCert.
@SuppressWarnings("unused")
@FXML
void onCmdNewCert(ActionEvent evt) {
UserCertStore store = this.storeProperty.get();
if (store != null) {
try {
CertOptionsController certOptions = loadStage(CertOptionsController.class).init(store, getSelectedStoreEntry(), this.userPreferences.expertMode.getBoolean(false));
certOptions.showAndWait();
updateStoreEntryView();
} catch (IOException e) {
Alerts.unexpected(e).showAndWait();
}
}
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class UserCertStoreTest method testURLSourceStore.
/**
* Test store creation from URL source.
*/
@Test
public void testURLSourceStore() {
try {
UserCertStore importStore = UserCertStore.createFromURL(TestCerts.simplePKCS12URL(), TestCerts.password());
Assert.assertNotNull(importStore);
Assert.assertTrue(importStore.size() > 0);
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
Aggregations