diff --git a/build/debian/otgc_native.sh b/build/debian/otgc_native.sh
index 8ac5ba2..277c6f2 100755
--- a/build/debian/otgc_native.sh
+++ b/build/debian/otgc_native.sh
@@ -11,7 +11,7 @@
# Constants
PROJECT_NAME="otgc"
-VERSION="2.5.0"
+VERSION="2.6.0"
program=$0
diff --git a/pom.xml b/pom.xml
index 4fc3c4a..ff71312 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
otgc
otgc
- 2.5.0
+ 2.6.0
UTF-8
diff --git a/src/main/java/org/openconnectivity/otgc/view/trustanchor/TrustAnchorView.java b/src/main/java/org/openconnectivity/otgc/view/trustanchor/TrustAnchorView.java
index 132436e..2b313c6 100644
--- a/src/main/java/org/openconnectivity/otgc/view/trustanchor/TrustAnchorView.java
+++ b/src/main/java/org/openconnectivity/otgc/view/trustanchor/TrustAnchorView.java
@@ -22,6 +22,7 @@
import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
import javafx.beans.binding.Bindings;
+import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
@@ -31,6 +32,8 @@
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.encoders.Base64;
import org.openconnectivity.otgc.domain.model.resource.secure.cred.OcCredential;
+import org.openconnectivity.otgc.utils.util.Toast;
+import org.openconnectivity.otgc.utils.viewmodel.Response;
import org.openconnectivity.otgc.viewmodel.TrustAnchorViewModel;
import javax.inject.Inject;
@@ -50,17 +53,23 @@ public class TrustAnchorView implements FxmlView, Initiali
@Inject
private Stage primaryStage;
+ private ResourceBundle resourceBundle;
+
@FXML private ListView listView;
@FXML private JFXButton infoCaButton;
@FXML private JFXButton removeCaButton;
@Override
public void initialize(URL location, ResourceBundle resources) {
+ this.resourceBundle = resourceBundle;
+
viewModel.retrieveTrustAnchors();
listView.itemsProperty().bind(viewModel.trustAnchorListProperty());
listView.setCellFactory(deviceListView -> new TrustAnchorViewCell());
+ viewModel.storeTrustAnchorResponseProperty().addListener(this::processStoreTrustAnchorResponse);
+
infoCaButton.disableProperty().bind(Bindings.createBooleanBinding(() ->
listView.getSelectionModel().getSelectedItem() == null,
listView.getSelectionModel().selectedItemProperty()));
@@ -139,6 +148,16 @@ public void handleAddCaButton() {
}
}
+ private void processStoreTrustAnchorResponse(ObservableValue extends Response> obs, Response oldValue, Response newValue) {
+ switch (newValue.status) {
+ case ERROR:
+ Toast.show(primaryStage, resourceBundle.getString("trustanchor.create_cred.error"));
+ break;
+ default:
+ break;
+ }
+ }
+
@FXML
public void handleRemoveCaButton() {
viewModel.removeTrustAnchorByCredid(listView.getSelectionModel().getSelectedItem().getCredid());
diff --git a/src/main/java/org/openconnectivity/otgc/viewmodel/TrustAnchorViewModel.java b/src/main/java/org/openconnectivity/otgc/viewmodel/TrustAnchorViewModel.java
index 1c8d4c3..a4c4bee 100644
--- a/src/main/java/org/openconnectivity/otgc/viewmodel/TrustAnchorViewModel.java
+++ b/src/main/java/org/openconnectivity/otgc/viewmodel/TrustAnchorViewModel.java
@@ -53,6 +53,7 @@ public class TrustAnchorViewModel implements ViewModel {
public ListProperty trustAnchorListProperty() {
return trustAnchorList;
}
+ private final ObjectProperty> storeTrustAnchorResponse = new SimpleObjectProperty<>();
@Inject
public TrustAnchorViewModel(SchedulersFacade schedulersFacade,
@@ -65,6 +66,10 @@ public TrustAnchorViewModel(SchedulersFacade schedulersFacade,
this.remoteRemoveTrustAnchorByCredidUseCase = remoteRemoveTrustAnchorByCredidUseCase;
}
+ public ObjectProperty> storeTrustAnchorResponseProperty() {
+ return storeTrustAnchorResponse;
+ }
+
public void retrieveTrustAnchors() {
disposable.add(getTrustAnchorUseCase.execute()
.subscribeOn(schedulersFacade.io())
@@ -82,7 +87,7 @@ public void addTrustAnchor(File file) {
.observeOn(schedulersFacade.ui())
.subscribe(
() -> retrieveTrustAnchors(),
- throwable -> {}
+ throwable -> storeTrustAnchorResponse.set(Response.error(throwable))
));
}
diff --git a/src/main/resources/data/kyrio-ee-cert.pem b/src/main/resources/data/kyrio-ee-cert.pem
index 6ab9a5d..3ee52a3 100644
--- a/src/main/resources/data/kyrio-ee-cert.pem
+++ b/src/main/resources/data/kyrio-ee-cert.pem
@@ -1,14 +1,14 @@
-----BEGIN CERTIFICATE-----
-MIIEEzCCA7mgAwIBAgIJAI0K+3tTskzXMAoGCCqGSM49BAMCMFsxDDAKBgNVBAoM
+MIIEEzCCA7mgAwIBAgIJAI0K+3tTsk0AMAoGCCqGSM49BAMCMFsxDDAKBgNVBAoM
A09DRjEiMCAGA1UECwwZS3lyaW8gVGVzdCBJbmZyYXN0cnVjdHVyZTEnMCUGA1UE
-AwweS3lyaW8gVEVTVCBJbnRlcm1lZGlhdGUgQ0EwMDAyMB4XDTE5MDkyMzA5MjUx
-OFoXDTE5MTAyMzA5MjUxOFowYTEMMAoGA1UECgwDT0NGMSIwIAYDVQQLDBlLeXJp
+AwweS3lyaW8gVEVTVCBJbnRlcm1lZGlhdGUgQ0EwMDAyMB4XDTE5MTAyNDA5NDg1
+NFoXDTE5MTEyMzA5NDg1NFowYTEMMAoGA1UECgwDT0NGMSIwIAYDVQQLDBlLeXJp
byBUZXN0IEluZnJhc3RydWN0dXJlMS0wKwYDVQQDDCQxZTFiZWJmYi04ZjAzLTQ3
-ODUtNWZhNy0xYjcwNGU2NTQzNjAwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQj
-V7MJwkO4J4PWR4KgbVHrFHSQipHMRNu704OPmnAQQ3tnEhjnYxn0TODDvN8YekE5
-voDDOX98mYpxhPa5hz52o4ICXjCCAlowCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMC
+ODUtNWZhNy0xYjcwNGU2NTQzNjAwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATW
+d0t/5GahEMUSb8dhaOIZdTDHDTelbWWfjSxA6OhcMy1uKGewCg7e2R2ZTK7ZM/th
+KSXuMywN0JXA6BoW9on8o4ICXjCCAlowCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMC
A4gwKQYDVR0lBCIwIAYIKwYBBQUHAwIGCCsGAQUFBwMBBgorBgEEAYLefAEGMB0G
-A1UdDgQWBBRjlMq7Dkw3IN1X1CTuDLEITgjQGTAfBgNVHSMEGDAWgBQZc2oEGgsH
+A1UdDgQWBBS+4P5iaPJfppBg66266sma6Ffe9jAfBgNVHSMEGDAWgBQZc2oEGgsH
cE9TeVM2h/wMunyuCzCBlgYIKwYBBQUHAQEEgYkwgYYwXQYIKwYBBQUHMAKGUWh0
dHA6Ly90ZXN0cGtpLmt5cmlvLmNvbS9vY2YvY2FjZXJ0cy9CQkU2NEY5QTdFRTM3
RDI5QTA1RTRCQjc3NTk1RjMwOEJFNDFFQjA3LmNydDAlBggrBgEFBQcwAYYZaHR0
@@ -19,6 +19,6 @@ AjBgBgorBgEEAYORVgEABFIwUDAJAgECAgEAAgEAMDYMGTEuMy42LjEuNC4xLjUx
NDE0LjAuMC4xLjAMGTEuMy42LjEuNC4xLjUxNDE0LjAuMC4yLjAMBE9UR0MMBURF
S1JBMCoGCisGAQQBg5FWAQEEHDAaBgsrBgEEAYORVgEBAAYLKwYBBAGDkVYBAQEw
MAYKKwYBBAGDkVYBAgQiMCAMDjEuMy42LjEuNC4xLjcxDAlEaXNjb3ZlcnkMAzEu
-MDAKBggqhkjOPQQDAgNIADBFAiBLKD1R5LUOUJdMq2VWlzbzpZjvLeN1CFQIPS4y
-cjbm9wIhANmGPf7y8/s/fKWy/dEaIGjo79lButKOe0JWZaburW3P
+MDAKBggqhkjOPQQDAgNIADBFAiEA3Ay4oPSGwARJWub9/k58xiqARpRKjCDaGGZi
+mHTurqYCIC/e7Y9NAMiweZZ2JaGAYXC7T8YTqAFneT9jaq2o3c9m
-----END CERTIFICATE-----
diff --git a/src/main/resources/data/kyrio-ee-key.pem b/src/main/resources/data/kyrio-ee-key.pem
index 74373c9..eb4fad6 100644
--- a/src/main/resources/data/kyrio-ee-key.pem
+++ b/src/main/resources/data/kyrio-ee-key.pem
@@ -1,5 +1,8 @@
+-----BEGIN EC PARAMETERS-----
+BggqhkjOPQMBBw==
+-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
-MHcCAQEEIChO1xeRf0WA/npKbjLKPzlnTDhE7v95O5ZG2fhZbBjLoAoGCCqGSM49
-AwEHoUQDQgAEI1ezCcJDuCeD1keCoG1R6xR0kIqRzETbu9ODj5pwEEN7ZxIY52MZ
-9Ezgw7zfGHpBOb6Awzl/fJmKcYT2uYc+dg==
+MHcCAQEEIDUCAKRYHFbz7MVYj4LASsOxX54sYcVNbE4MLwIa/0j/oAoGCCqGSM49
+AwEHoUQDQgAE1ndLf+RmoRDFEm/HYWjiGXUwxw03pW1ln40sQOjoXDMtbihnsAoO
+3tkdmUyu2TP7YSkl7jMsDdCVwOgaFvaJ/A==
-----END EC PRIVATE KEY-----
diff --git a/src/main/resources/properties/Strings_en.properties b/src/main/resources/properties/Strings_en.properties
index b19dd3b..676c575 100644
--- a/src/main/resources/properties/Strings_en.properties
+++ b/src/main/resources/properties/Strings_en.properties
@@ -163,6 +163,7 @@ linkdevices.radiobutton.uuid=UUID
linkdevices.radiobutton.role=Role
linkdevices.label.role_id=Role ID
linkdevices.label.role_authority= Role authority
+trustanchor.create_cred.error=Cannot store root certificate from the selected location
## Dialog
dialog.title.select_oxm=Select OTM