Skip to content

Commit

Permalink
Merge branch 'main' into add-orsr-eforms
Browse files Browse the repository at this point in the history
  • Loading branch information
celuchmarek committed Jan 12, 2024
2 parents b8e8df1 + 3e3ceb5 commit 7f81013
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 13 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ Doplniť ďalšie je pomerne ľahké pokiaľ používajú PKCS#11.

Odporúčame používať Liberica JDK, ktoré má v sebe JavaFX, všetko je potom jednoduchšie. Po zavolaní `./mvnw initialize` by sa malo stiahnuť do `target/jdkCache`.

#### Fedora

```sh
sudo dnf install rpm-build
```

### Build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,16 @@ public static VBox createSignatureBox(Reports reports, boolean isValidated, Stri
isRevocationValidated = false;

var isTimestampInvalid = false;
for (var timestamp : timestamps)
if (timestamp.getIndication().equals(Indication.FAILED))
var isTimestampIndeterminate = false;
for (var timestamp : timestamps) {
var indication = timestamp.getIndication();
if (indication.equals(Indication.FAILED) || indication.equals(Indication.TOTAL_FAILED))
isTimestampInvalid = true;

if (indication.equals(Indication.INDETERMINATE))
isTimestampIndeterminate = true;
}

Node badge = null;
if (!isValidated)
badge = SignatureBadgeFactory.createInProgressBadge();
Expand All @@ -144,8 +150,7 @@ else if (isFailed)
createTableRow("Výsledok overenia",
isValidated
? validityToString(isValid, isFailed, areTLsLoaded, isRevocationValidated,
signatureQualification,
isTimestampInvalid)
signatureQualification, isTimestampInvalid, isTimestampIndeterminate)
: "Prebieha overovanie"),
createTableRow("Certifikát", subject),
createTableRow("Vydavateľ", issuer),
Expand All @@ -168,7 +173,9 @@ else if (isFailed)
}

private static String validityToString(boolean isValid, boolean isFailed, boolean areTLsLoaded,
boolean isRevocationValidated, SignatureQualification signatureQualification, boolean isTimestampInvalid) {
boolean isRevocationValidated, SignatureQualification signatureQualification, boolean isTimestampInvalid,
boolean isTimestampIndeterminate) {

if (isFailed || isTimestampInvalid)
return "Neplatný";

Expand All @@ -178,13 +185,12 @@ private static String validityToString(boolean isValid, boolean isFailed, boolea
if (!isRevocationValidated)
return "Nepodarilo sa overiť platnosť certifikátu";

if (signatureQualification.getReadable().contains("Indeterminate") || isTimestampIndeterminate)
return "Predbežne platný";

if (isValid)
return "Platný";

if (signatureQualification.getReadable().contains("INDETERMINATE")
|| signatureQualification.getReadable().contains("ndeterminate"))
return "Predbežne platný";

return "Neznámy podpis";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,22 @@ private static HBox createMultipleBadges(SignatureQualification signatureQualifi
var isQualified = timestamp.getQualificationDetails() != null;
var isFailed = timestamp.getIndication() == Indication.TOTAL_FAILED
|| timestamp.getIndication() == Indication.FAILED;
var isIndeterminate = timestamp.getIndication() == Indication.INDETERMINATE;

if (isFailed)
flowPane.getChildren().add(createInvalidBadge("Neplatná ČP"));

else if (isIndeterminate)
flowPane.getChildren().add(
createUnknownBadge("Neznáma ČP"));

else if (isQualified)
flowPane.getChildren().add(
createValidQualifiedBadge(simple.getTimestampQualification(timestamp.getId()).getReadable()));

else
flowPane.getChildren()
.add(createUnknownBadge(simple.getTimestampQualification(timestamp.getId()).getReadable()));
flowPane.getChildren().add(
createUnknownBadge("Neznáma ČP"));
}

return new HBox(flowPane);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<?import javafx.scene.control.Hyperlink?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<BorderPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" prefWidth="500" minWidth="450">
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.geometry.Insets?>
<BorderPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" prefWidth="600" minWidth="450">
<center>
<VBox fx:id="mainBox">
<VBox>
Expand All @@ -27,7 +31,9 @@

<TextFlow styleClass="autogram-body-s">
<Text styleClass="autogram-body-s"
text="Autormi tohto projektu sú Jakub Ďuraš, Slovensko.Digital, CRYSTAL&#160;CONSULTING,&#160;s.r.o, Solver&#160;IT&#160;s.r.o. a ďalší spoluautori."/>
text="Autormi tohto projektu sú Jakub Ďuraš, Slovensko.Digital, CRYSTAL&#160;CONSULTING,&#160;s.r.o, Solver&#160;IT&#160;s.r.o. a ďalší spoluautori. "/>
<Text styleClass="autogram-body-s"
text="Tento projekt je spolufinancovaný z&#160;prostriedkov Európskeho fondu regionálneho rozvoja v&#160;rámci Operačného programu Integrovaná infraštruktúra."/>
</TextFlow>

<TextFlow styleClass="autogram-heading-s">
Expand All @@ -43,6 +49,21 @@
<Hyperlink styleClass="autogram-body-s,autogram-link" text="GitHub-e" onAction="#githubLinkAction"/>
<Text styleClass="autogram-body-s" text="."/>
</TextFlow>

<StackPane>
<padding>
<Insets top="32" bottom="16" />
</padding>
<children>
<ImageView>
<fitWidth>550</fitWidth>
<preserveRatio>true</preserveRatio>
<image>
<Image url="@logo_OPII_ESIF.png" />
</image>
</ImageView>
</children>
</StackPane>
</VBox>
</VBox>
</VBox>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7f81013

Please sign in to comment.