Skip to content

Commit ecef739

Browse files
bielecrobielecro
bielecro
authored and
bielecro
committed
Merge branch 'release-4.3.0-RC'
2 parents a29d452 + 5a9b194 commit ecef739

File tree

128 files changed

+5658
-3793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+5658
-3793
lines changed

apps/dss/core/dss-common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
1010
<artifactId>sd-dss-app</artifactId>
11-
<version>4.2.0</version>
11+
<version>4.3.0-RC</version>
1212
<relativePath>../..</relativePath>
1313
</parent>
1414

-6.04 KB
Binary file not shown.

apps/dss/core/dss-document/pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
1010
<artifactId>sd-dss-app</artifactId>
11-
<version>4.2.0</version>
11+
<version>4.3.0-RC</version>
1212
<relativePath>../..</relativePath>
1313
</parent>
1414

@@ -84,10 +84,6 @@
8484
<groupId>org.bouncycastle</groupId>
8585
<artifactId>bcmail-jdk15on</artifactId>
8686
</dependency>
87-
<!--<dependency>-->
88-
<!--<groupId>org.bouncycastle</groupId>-->
89-
<!--<artifactId>bcpkix-jdk15on</artifactId>-->
90-
<!--</dependency>-->
9187
<dependency>
9288
<groupId>org.apache.santuario</groupId>
9389
<artifactId>xmlsec</artifactId>
@@ -105,6 +101,10 @@
105101
<groupId>org.apache.pdfbox</groupId>
106102
<artifactId>pdfbox</artifactId>
107103
</dependency>
104+
<dependency>
105+
<groupId>commons-lang</groupId>
106+
<artifactId>commons-lang</artifactId>
107+
</dependency>
108108
<dependency>
109109
<groupId>ch.qos.logback</groupId>
110110
<artifactId>logback-classic</artifactId>

apps/dss/core/dss-document/src/main/java/eu/europa/ec/markt/dss/parameter/BLevelParameters.java

+56-14
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@
3232

3333
public class BLevelParameters {
3434

35+
/**
36+
* This variable indicates if the Baseline profile's trust anchor policy shall be followed:
37+
* ETSI TS 103 171 V2.1.1 (2012-03)
38+
* 6.2.1 Placement of the signing certificate
39+
* ../..
40+
* it is advised to include at least the unavailable intermediary certificates up to but not including the CAs present in the TSLs,
41+
* ../..
42+
* This rule applies as follows: when -B level is constructed the trust anchor is not included, when -LT level is constructed the trust anchor is included.
43+
* NOTE: when trust anchor baseline profile policy is defined only the certificates previous to the trust anchor are included when -B level is constructed.
44+
*/
45+
private boolean trustAnchorBPPolicy = true;
46+
3547
private Date signingDate = new Date();
3648

3749
/**
@@ -53,28 +65,32 @@ public class BLevelParameters {
5365
private String contentHintsType;
5466
private String contentHintsDescription;
5567

56-
public BLevelParameters() {
57-
68+
/**
69+
* Default constructor
70+
*/
71+
BLevelParameters() {
5872
}
5973

74+
/**
75+
* Copy constructor.
76+
*
77+
* @param source {@code BLevelParameters} source parameters
78+
*/
6079
BLevelParameters(final BLevelParameters source) {
6180

6281
if (source == null) {
63-
6482
throw new DSSNullException(BLevelParameters.class);
6583
}
66-
if (source.signaturePolicy != null) {
6784

85+
this.trustAnchorBPPolicy = source.trustAnchorBPPolicy;
86+
if (source.signaturePolicy != null) {
6887
this.signaturePolicy = new Policy(source.signaturePolicy);
6988
}
7089
this.signingDate = source.signingDate;
71-
7290
if (source.claimedSignerRoles != null) {
73-
7491
this.claimedSignerRoles = new ArrayList<String>(source.claimedSignerRoles);
7592
}
7693
if (source.certifiedSignerRoles != null) {
77-
7894
this.certifiedSignerRoles = new ArrayList<String>(source.certifiedSignerRoles);
7995
}
8096

@@ -85,15 +101,43 @@ public BLevelParameters() {
85101
this.contentIdentifierSuffix = source.contentIdentifierSuffix;
86102

87103
if (source.commitmentTypeIndication != null) {
88-
89104
this.commitmentTypeIndication = new ArrayList<String>(source.commitmentTypeIndication);
90105
}
91106
if (source.signerLocation != null) {
92-
93107
this.signerLocation = new SignerLocation(source.signerLocation);
94108
}
95109
}
96110

111+
/**
112+
* @return indicates the trust anchor policy shall be used when creating -B and -LT levels
113+
*/
114+
public boolean isTrustAnchorBPPolicy() {
115+
return trustAnchorBPPolicy;
116+
}
117+
118+
/**
119+
* Allows to set the trust anchor policy to use when creating -B and -LT levels.
120+
* NOTE: when trust anchor baseline profile policy is defined only the certificates previous to the trust anchor are included when building -B level.
121+
*
122+
* @param trustAnchorBPPolicy {@code boolean}
123+
*/
124+
public void setTrustAnchorBPPolicy(boolean trustAnchorBPPolicy) {
125+
this.trustAnchorBPPolicy = trustAnchorBPPolicy;
126+
}
127+
128+
/**
129+
* @return the signature policy to use during the signature creation process
130+
*/
131+
public Policy getSignaturePolicy() {
132+
133+
return signaturePolicy;
134+
}
135+
136+
/**
137+
* This setter allows to indicate the signature policy to use.
138+
*
139+
* @param signaturePolicy signature policy to use
140+
*/
97141
public void setSignaturePolicy(final Policy signaturePolicy) {
98142

99143
this.signaturePolicy = signaturePolicy;
@@ -249,6 +293,9 @@ public void addPostalAddress(final String addressItem) {
249293
}
250294
}
251295

296+
/**
297+
* This inner class allows to define the signature policy.
298+
*/
252299
public static class Policy {
253300

254301
private String id;
@@ -323,11 +370,6 @@ public void setDigestValue(final byte[] digestValue) {
323370

324371
}
325372

326-
public Policy getSignaturePolicy() {
327-
328-
return signaturePolicy;
329-
}
330-
331373
/**
332374
* Set the signing date
333375
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* DSS - Digital Signature Services
3+
*
4+
* Copyright (C) 2013 European Commission, Directorate-General Internal Market and Services (DG MARKT), B-1049 Bruxelles/Brussel
5+
*
6+
* Developed by: 2013 ARHS Developments S.A. (rue Nicolas Bové 2B, L-1253 Luxembourg) http://www.arhs-developments.com
7+
*
8+
* This file is part of the "DSS - Digital Signature Services" project.
9+
*
10+
* "DSS - Digital Signature Services" is free software: you can redistribute it and/or modify it under the terms of
11+
* the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* DSS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public License along with
18+
* "DSS - Digital Signature Services". If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
package eu.europa.ec.markt.dss.parameter;
22+
23+
import java.security.cert.X509Certificate;
24+
25+
import eu.europa.ec.markt.dss.exception.DSSNullException;
26+
27+
/**
28+
* This class represent an element of the certificate chain. Each element is composed of a {@code X509Certificate} and a {@code boolean} value idicating if the certificate must be
29+
* part of the signing certificate signed attribute.
30+
* <p/>
31+
* DISCLAIMER: Project owner DG-MARKT.
32+
*
33+
* @author <a href="mailto:[email protected]">ARHS Developments</a>
34+
* @version $Revision: 1016 $ - $Date: 2011-06-17 15:30:45 +0200 (Fri, 17 Jun 2011) $
35+
*/
36+
public class ChainCertificate {
37+
38+
private X509Certificate x509Certificate;
39+
private boolean signedAttribute;
40+
41+
/**
42+
* This is the default constructor.
43+
*
44+
* @param x509Certificate encapsulated {@code X509Certificate}
45+
*/
46+
public ChainCertificate(final X509Certificate x509Certificate) {
47+
48+
if (x509Certificate == null) {
49+
throw new DSSNullException(X509Certificate.class);
50+
}
51+
this.x509Certificate = x509Certificate;
52+
}
53+
54+
/**
55+
* This is the full constructor associating the {@code X509Certificate} and the information indicating if the certificate must be added to the signing certificate signed
56+
* attribute.
57+
*
58+
* @param x509Certificate encapsulated {@code X509Certificate}
59+
* @param signedAttribute indicated if the certificate must be part of the signing certificate signed attribute
60+
*/
61+
public ChainCertificate(final X509Certificate x509Certificate, final boolean signedAttribute) {
62+
63+
this(x509Certificate);
64+
this.signedAttribute = signedAttribute;
65+
}
66+
67+
public X509Certificate getX509Certificate() {
68+
return x509Certificate;
69+
}
70+
71+
public void setX509Certificate(final X509Certificate x509Certificate) {
72+
this.x509Certificate = x509Certificate;
73+
}
74+
75+
public boolean isSignedAttribute() {
76+
return signedAttribute;
77+
}
78+
79+
public void setSignedAttribute(final boolean signedAttribute) {
80+
this.signedAttribute = signedAttribute;
81+
}
82+
83+
@Override
84+
public boolean equals(final Object o) {
85+
86+
if (this == o) {
87+
return true;
88+
}
89+
if (o == null || getClass() != o.getClass()) {
90+
return false;
91+
}
92+
final ChainCertificate that = (ChainCertificate) o;
93+
if (!x509Certificate.equals(that.x509Certificate)) {
94+
return false;
95+
}
96+
return true;
97+
}
98+
99+
@Override
100+
public int hashCode() {
101+
return x509Certificate.hashCode();
102+
}
103+
}

apps/dss/core/dss-document/src/main/java/eu/europa/ec/markt/dss/parameter/DSSTransform.java

+18
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class DSSTransform {
3535
String elementName;
3636
String namespace;
3737
String textContent;
38+
private boolean perform = false;
3839

3940
public DSSTransform() {
4041
}
@@ -47,6 +48,7 @@ public DSSTransform() {
4748
public DSSTransform(final DSSTransform transform) {
4849

4950
algorithm = transform.algorithm;
51+
perform = transform.perform;
5052
elementName = transform.elementName;
5153
namespace = transform.namespace;
5254
textContent = transform.textContent;
@@ -60,6 +62,21 @@ public void setAlgorithm(String algorithm) {
6062
this.algorithm = algorithm;
6163
}
6264

65+
/**
66+
* The framework (4.3.0-RC) is able to cope in automated manner only with some transformations: canonicalization & {@code Transforms.TRANSFORM_XPATH}. You need to set this
67+
* property to tell to the framework to perform the transformation. It applies only for {@code SignaturePackaging.ENVELOPED}.
68+
* The default value is {@code false}.
69+
*
70+
* @param perform indicates if the transformation should be performed
71+
*/
72+
public void setPerform(boolean perform) {
73+
this.perform = perform;
74+
}
75+
76+
public boolean isPerform() {
77+
return perform;
78+
}
79+
6380
public String getElementName() {
6481
return elementName;
6582
}
@@ -91,6 +108,7 @@ public String toString() {
91108
", elementName='" + elementName + '\'' +
92109
", namespace='" + namespace + '\'' +
93110
", textContent='" + textContent + '\'' +
111+
", perform=" + perform +
94112
'}';
95113
}
96114
}

0 commit comments

Comments
 (0)