Skip to content

Commit

Permalink
New release 1.3.0 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinattieng authored Sep 21, 2023
1 parent f3d10a0 commit 913c8c1
Show file tree
Hide file tree
Showing 40 changed files with 1,513 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
target
/target/
.project
.classpath
.settings
/.settings/
nb-configuration.xml
nbactions.xml
661 changes: 661 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
# Crypto model
# Verifica firma CRYPTO models

Il seguente progetto è da considerarsi come libreria contenente il "modello dati" legato al microservizio di [verifica firma crypto](https://gitlab.ente.regione.emr.it/parer/okd/crypto). Utilizzato in forma di dipendenza dal client [sacerws](https://gitlab.ente.regione.emr.it/parer/sacerws) e dal [microservizio](https://gitlab.ente.regione.emr.it/parer/okd/crypto) stesso.
Fonte template redazione documento: https://www.makeareadme.com/.


# Descrizione

Il seguente modulo è utilizzato come **dipendenza** dai progetti che prevedono una interazione con il servizio di Verifica firma CRYPTO in cui sono implementate le logiche di verifica di firme digitali dei formati più noti (vedi ETSI https://www.etsi.org/) e definisce i modelli (o wrapper) attraverso i quali, un qualunque client sviluppato in Java, può interagire con esso.

# Installazione

Come già specificato nel paragrafo precedente [Descrizione](# Descrizione) si tratta di un progetto di tipo "libreria", quindi un modulo applicativo utilizzato attraverso la definzione della dipendenza Maven secondo lo standard previsto (https://maven.apache.org/):

```xml
<dependency>
<groupId>it.eng.parer</groupId>
<artifactId>verificafirma-crypto-beans</artifactId>
<version>$VERSIONE</version>
</dependency>
```

# Utilizzo

L'utilizzo di questa libreria è legato all'invocazione, attraverso client sviluppati in linguaggio Java, del servizio di verifica firma crypto il quale permette di riconoscere e validare, documenti con firme digitali nei formati noti/standard (vedi ETSI https://www.etsi.org/). Il modulo si compone quindi delle classi base che il client potrà utilizzare sia in ambito di chiamata al servizio (oggetto da fornire in input) sia per la gestione della risposta (oggetto ottenuto in output). Per una maggiore comprensione della sintassi e della semantica dei singoli oggetti, è possibile consultare la documentazione delle Api RESTFul attraverso il servizio di verifica firma crypto e lo Swagger (https://swagger.io/) basato su OpenAPI 3.x, auto generato.

### javax.activation versus jakarta

Con il passaggio alla versione 17 di Java e dei framework utilizzati (nel caso specifico Spring Boot alla versione 3.x), si è dovuti passare al nuovo standard utilizzato sotto il package jakarta.* e non più javax.* (vedere release notes https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0.0-M1-Release-Notes).

# Supporto

Progetto a cura di [Engineering Ingegneria Informatica S.p.A.](https://www.eng.it/).

# Contributi

Se interessati a crontribuire alla crescita del progetto potete scrivere all'indirizzo email <a href="mailto:areasviluppoparer@regione.emilia-romagna.it">areasviluppoparer@regione.emilia-romagna.it</a>.

# Autori

Proprietà intellettuale del progetto di [Regione Emilia-Romagna](https://www.regione.emilia-romagna.it/) e [Polo Archivisitico](https://poloarchivistico.regione.emilia-romagna.it/).

# Licenza

Questo progetto è rilasciato sotto licenza GNU Affero General Public License v3.0 or later ([LICENSE.txt](LICENSE.txt)).
42 changes: 22 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>verificafirma-crypto-beans</artifactId>
<version>1.0.2-SNAPSHOT</version>
<version>1.3.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Verifica firma crypto beans</name>
<description>Libreria contenente i beans che integrano i modelli pojo per la verifica firma con microservizio crypto</description>
<url>https://nexus.ente.regione.emr.it/repository/parer-site/verificafirma-crypto-beans/${project.version}/</url>

<parent>
<groupId>it.eng.parer</groupId>
<artifactId>parer-pom</artifactId>
<version>3.0.17</version>
<version>4.2.0</version>
</parent>


<properties>
<skipTests>true</skipTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.encoding>UTF-8</project.encoding>
<!-- ereditata la versione utilizza da springboot dal progetto (crypto) di cui prima era un sottomodulo-->
<javax.validation.version>2.0.1.Final</javax.validation.version>
<!-- ereditata la versione utilizza da springboot 3.x dal progetto (crypto) di cui prima era un sottomodulo-->
<jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
<junit.version>4.13.1</junit.version>
<!-- Jaxb compliance java 11 (optional on java 8) -->
<jaxb.api.version>2.3.0</jaxb.api.version>
<javax.activation.version>1.2.0</javax.activation.version>
</properties>

<scm>
<developerConnection>scm:git:https://github.com/RegioneER/parer.sacer.verificafirma-crypto.beans.git</developerConnection>
<developerConnection>scm:git:https://github.com/RegioneER/parer-verificafirma-crypto-beans.git</developerConnection>
<tag>HEAD</tag>
</scm>

Expand All @@ -38,17 +38,12 @@
</repositories>

<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${javax.validation.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>${jakarta.validation-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
Expand All @@ -65,9 +60,16 @@
<version>${jaxb.api.version}</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
<version>${javax.activation.version}</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
17 changes: 17 additions & 0 deletions src/main/java/it/eng/parer/crypto/model/CryptoEnums.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Engineering Ingegneria Informatica S.p.A.
*
* Copyright (C) 2023 Regione Emilia-Romagna
* <p/>
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* <p/>
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/it/eng/parer/crypto/model/ParerCRL.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Engineering Ingegneria Informatica S.p.A.
*
* Copyright (C) 2023 Regione Emilia-Romagna
* <p/>
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* <p/>
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/

package it.eng.parer.crypto.model;

import java.io.Serializable;
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/it/eng/parer/crypto/model/ParerCertificate.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Engineering Ingegneria Informatica S.p.A.
*
* Copyright (C) 2023 Regione Emilia-Romagna
* <p/>
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* <p/>
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/

package it.eng.parer.crypto.model;

import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Engineering Ingegneria Informatica S.p.A.
*
* Copyright (C) 2023 Regione Emilia-Romagna
* <p/>
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* <p/>
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/

package it.eng.parer.crypto.model;

import java.io.Serializable;
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/it/eng/parer/crypto/model/ParerTSD.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Engineering Ingegneria Informatica S.p.A.
*
* Copyright (C) 2023 Regione Emilia-Romagna
* <p/>
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* <p/>
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/

package it.eng.parer.crypto.model;

import java.io.Serializable;
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/it/eng/parer/crypto/model/ParerTST.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Engineering Ingegneria Informatica S.p.A.
*
* Copyright (C) 2023 Regione Emilia-Romagna
* <p/>
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* <p/>
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/

package it.eng.parer.crypto.model;

import java.io.Serializable;
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/it/eng/parer/crypto/model/ValidationInfos.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Engineering Ingegneria Informatica S.p.A.
*
* Copyright (C) 2023 Regione Emilia-Romagna
* <p/>
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* <p/>
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/

package it.eng.parer.crypto.model;

import it.eng.parer.crypto.model.CryptoEnums.EsitoControllo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
/*
* Engineering Ingegneria Informatica S.p.A.
*
* Copyright (C) 2023 Regione Emilia-Romagna
* <p/>
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* <p/>
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/

package it.eng.parer.crypto.model.exceptions;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

import it.eng.parer.crypto.model.verifica.input.CryptoDataToValidateMetadata;

/**
*
* @author Snidero_L
Expand All @@ -14,20 +34,36 @@ public class CryptoParerException extends RuntimeException implements ParerError

private String message;

private List<String> details = new ArrayList<String>();
private List<String> details = new ArrayList<>();

private ErrorCode code = ErrorCode.GENERIC_ERROR;

private String moreInfo;

private CryptoDataToValidateMetadata metadata;

// Costrutture a 0 parametri altrimenti come deserializzo?
public CryptoParerException() {
super();
}

public CryptoParerException(CryptoDataToValidateMetadata metadata) {
super();
this.metadata = metadata;
}

public CryptoParerException(Throwable cause) {
super(cause);
}

public CryptoParerException(CryptoDataToValidateMetadata metadata, Throwable cause) {
this(cause);
this.metadata = metadata;
}

@Override
public String getMessage() {
return message;
return stdMsgPrefix() + message;
}

public void setMessage(String message) {
Expand Down Expand Up @@ -68,6 +104,11 @@ public void setMoreInfo(String moreInfo) {
this.moreInfo = moreInfo;
}

@Override
public CryptoDataToValidateMetadata getMetadata() {
return this.metadata;
}

public CryptoParerException withMoreInfo(String moreInfo) {
setMoreInfo(moreInfo);
return this;
Expand All @@ -88,6 +129,13 @@ public CryptoParerException withDetail(String message) {
return this;
}

public CryptoParerException withDetails(List<String> messages) {
if (messages != null) {
messages.forEach(this::addDetail);
}
return this;
}

/*
* (non-Javadoc)
*
Expand All @@ -96,8 +144,8 @@ public CryptoParerException withDetail(String message) {
@Override
public String toString() {
return "message=" + message + " - details="
+ details.stream().map(Object::toString).collect(Collectors.joining(",")) + " - code=" + code
+ " - moreInfo=" + moreInfo;
+ details.stream().filter(Objects::nonNull).map(Object::toString).collect(Collectors.joining(","))
+ " - code=" + code + " - moreInfo=" + moreInfo;
}

}
Loading

0 comments on commit 913c8c1

Please sign in to comment.