Search in sources :

Example 1 with CRLOptionsController

use of de.carne.certmgr.jfx.crloptions.CRLOptionsController in project certmgr by hdecarne.

the class StoreController method onCmdRevokeCert.

@SuppressWarnings("unused")
@FXML
void onCmdRevokeCert(ActionEvent evt) {
    UserCertStoreEntry entry = getSelectedStoreEntry();
    if (entry != null) {
        UserCertStoreEntry issuerEntry = entry.issuer();
        if (!entry.isSelfSigned() && issuerEntry.hasPublicKey() && issuerEntry.hasKey()) {
            try {
                CRLOptionsController crlOptionsController = loadStage(CRLOptionsController.class).init(issuerEntry, this.userPreferences.expertMode.getBoolean(false));
                crlOptionsController.revokeStoreEntry(entry, ReasonFlag.UNSPECIFIED);
                crlOptionsController.showAndWait();
                updateStoreEntryView();
            } catch (IOException e) {
                Alerts.unexpected(e).showAndWait();
            }
        } else {
            Alerts.message(AlertType.WARNING, StoreI18N.formatSTR_MESSAGE_CANNOT_REVOKE_CRT(issuerEntry), ButtonType.OK).showAndWait();
        }
    }
}
Also used : CRLOptionsController(de.carne.certmgr.jfx.crloptions.CRLOptionsController) IOException(java.io.IOException) UserCertStoreEntry(de.carne.certmgr.certs.UserCertStoreEntry) FXML(javafx.fxml.FXML)

Example 2 with CRLOptionsController

use of de.carne.certmgr.jfx.crloptions.CRLOptionsController in project certmgr by hdecarne.

the class StoreController method onCmdManageCRL.

@SuppressWarnings("unused")
@FXML
void onCmdManageCRL(ActionEvent evt) {
    UserCertStoreEntry issuerEntry = getSelectedStoreEntry();
    if (issuerEntry != null) {
        if (issuerEntry.hasPublicKey() && issuerEntry.hasKey()) {
            try {
                CRLOptionsController crlOptionsController = loadStage(CRLOptionsController.class).init(issuerEntry, this.userPreferences.expertMode.getBoolean(false));
                crlOptionsController.showAndWait();
                updateStoreEntryView();
            } catch (IOException e) {
                Alerts.unexpected(e).showAndWait();
            }
        } else {
            Alerts.message(AlertType.WARNING, StoreI18N.formatSTR_MESSAGE_CANNOT_MANAGE_CRL(issuerEntry), ButtonType.OK).showAndWait();
        }
    }
}
Also used : CRLOptionsController(de.carne.certmgr.jfx.crloptions.CRLOptionsController) IOException(java.io.IOException) UserCertStoreEntry(de.carne.certmgr.certs.UserCertStoreEntry) FXML(javafx.fxml.FXML)

Aggregations

UserCertStoreEntry (de.carne.certmgr.certs.UserCertStoreEntry)2 CRLOptionsController (de.carne.certmgr.jfx.crloptions.CRLOptionsController)2 IOException (java.io.IOException)2 FXML (javafx.fxml.FXML)2