Skip to content

Commit e09766c

Browse files
committed
0.0.6 for Maven Central
1 parent bd31557 commit e09766c

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.github.martinpaljak</groupId>
66
<artifactId>cdoc4j</artifactId>
77
<packaging>jar</packaging>
8-
<version>0.0.5</version>
8+
<version>0.0.6</version>
99
<name>cdoc4j</name>
1010
<description>Java library for handling CDOC 1.0/1.1/2.0 files with AES-256 GCM and RSA or ECC recipients
1111
</description>

src/main/java/asic4j/ContainerFile.java

-7
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,6 @@ public boolean check(List<String> errors) throws IOException {
168168
return true;
169169
}
170170

171-
/**
172-
* Get a file from the container with the given path.
173-
*
174-
* @param name path of the file in zip container
175-
* @return bytes of the file
176-
* @throws IOException
177-
*/
178171
public byte[] get(String name) throws IOException {
179172
ZipEntry ze = zf.getEntry(name);
180173
if (ze == null)

src/main/java/org/cdoc4j/XML.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public static List<Node> asList(NodeList n) {
148148
}
149149

150150
public static boolean validate_cdoc(byte[] d) throws IOException {
151-
try (InputStream schema = XML.class.getResourceAsStream("xenc-schema.xsd")) {
151+
try (InputStream schema = XML.class.getResourceAsStream("xenc-schema-11.xsd")) {
152152
return validate(d, schema);
153153
}
154154
}

src/test/java/TestEncryptDummy.java renamed to src/test/java/org/cdoc4j/TestEncryptDummy.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
package org.cdoc4j;
2+
13
import org.apache.commons.io.IOUtils;
2-
import org.cdoc4j.*;
34
import org.esteid.hacker.FakeEstEIDCA;
45
import org.junit.*;
56
import org.junit.rules.TestName;
@@ -37,13 +38,13 @@ public class TestEncryptDummy {
3738
public static void resources() throws Exception {
3839
// Extract resource
3940
dummy = Files.createTempFile(null, null);
40-
IOUtils.copy(TestEncryptDummy.class.getResourceAsStream("CDOC-A-101-7.pdf"), Files.newOutputStream(dummy));
41+
IOUtils.copy(TestEncryptDummy.class.getResourceAsStream("/CDOC-A-101-7.pdf"), Files.newOutputStream(dummy));
4142
System.out.println("Input file sizes: " + (Files.size(dummy)));
4243

4344
// Parse certificates
4445
CertificateFactory cf = CertificateFactory.getInstance("X509");
45-
ecc = (X509Certificate) cf.generateCertificate(TestEncryptDummy.class.getResourceAsStream("sk-auth-ecc.pem"));
46-
rsa = (X509Certificate) cf.generateCertificate(TestEncryptDummy.class.getResourceAsStream("sk-auth.pem"));
46+
ecc = (X509Certificate) cf.generateCertificate(TestEncryptDummy.class.getResourceAsStream("/sk-auth-ecc.pem"));
47+
rsa = (X509Certificate) cf.generateCertificate(TestEncryptDummy.class.getResourceAsStream("/sk-auth.pem"));
4748
}
4849

4950
@Before

src/test/java/org/cdoc4j/TestFullCycle.java

+4
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public void testV20RSA() throws Exception {
173173
CDOCBuilder creator = new CDOCBuilder(CDOC.VERSION.CDOC_V2_0);
174174
creator.addStream(HELLONAME, new ByteArrayInputStream(helloWorld));
175175
creator.addRecipient(rsacertificate);
176+
creator.withValidation(true);
176177
creator.setOutputStream(mem);
177178
creator.build();
178179

@@ -195,6 +196,7 @@ public void testV20Combined() throws Exception {
195196
creator.addRecipient(rsacertificate);
196197
creator.addRecipient(ecccertificate);
197198

199+
creator.withValidation(true);
198200
creator.setOutputStream(mem);
199201
creator.build();
200202

@@ -219,6 +221,8 @@ public void testZipOutputStream() throws Exception {
219221
CDOCBuilder creator = new CDOCBuilder(VERSION.CDOC_V2_0);
220222
creator.addRecipient(ecccertificate);
221223
creator.setOutputStream(mem);
224+
creator.withPrivacy(true);
225+
creator.withValidation(true);
222226
try (ZipOutputStream zos = creator.buildZipOutputStream()) {
223227
zos.putNextEntry(new ZipEntry(HELLONAME));
224228
zos.write(helloWorld);

0 commit comments

Comments
 (0)