From fac34cd579febf02d49b95845fe7928d61c66c87 Mon Sep 17 00:00:00 2001 From: Leandro Souza Costa Date: Mon, 5 Feb 2018 16:26:41 -0200 Subject: [PATCH] Changes in TimeStamp Token provider to permit HTTPS and monitoring --- .gitignore | 5 ++++- pom.xml | 14 +++++++++++++- .../impl/AbstractTimeStampTokenProvider.java | 2 +- .../providers/impl/HttpTimeStampTokenProvider.java | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f14d3427..16b8201f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ -/target +.classpath +.project +.settings +target/ /.idea /out nb-configuration.xml diff --git a/pom.xml b/pom.xml index 38304677..8453d6d4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.googlecode.xades4j xades4j jar - 1.3.3-SILEGIS-SNAPSHOT + 1.3.3-SILEGISMG-SNAPSHOT xades4j https://github.com/luisgoncalves/xades4j @@ -197,6 +197,18 @@ + + org.apache.maven.plugins + maven-jar-plugin + 3.0.2 + + + + test-jar + + + + diff --git a/src/main/java/xades4j/providers/impl/AbstractTimeStampTokenProvider.java b/src/main/java/xades4j/providers/impl/AbstractTimeStampTokenProvider.java index 234656e3..2b8deeea 100644 --- a/src/main/java/xades4j/providers/impl/AbstractTimeStampTokenProvider.java +++ b/src/main/java/xades4j/providers/impl/AbstractTimeStampTokenProvider.java @@ -68,7 +68,7 @@ private static ASN1ObjectIdentifier identifierForDigest(String digestAlgUri) { } @Override - public final TimeStampTokenRes getTimeStampToken(byte[] tsDigestInput, String digestAlgUri) throws TimeStampTokenGenerationException { + public TimeStampTokenRes getTimeStampToken(byte[] tsDigestInput, String digestAlgUri) throws TimeStampTokenGenerationException { byte[] digest; try { MessageDigest md = messageDigestProvider.getEngine(digestAlgUri); diff --git a/src/main/java/xades4j/providers/impl/HttpTimeStampTokenProvider.java b/src/main/java/xades4j/providers/impl/HttpTimeStampTokenProvider.java index 5a4f1f30..10ab66dd 100644 --- a/src/main/java/xades4j/providers/impl/HttpTimeStampTokenProvider.java +++ b/src/main/java/xades4j/providers/impl/HttpTimeStampTokenProvider.java @@ -92,7 +92,7 @@ protected byte[] getResponse(byte[] encodedRequest) throws TimeStampTokenGenerat } } - private HttpURLConnection createHttpConnection() throws IOException { + protected HttpURLConnection createHttpConnection() throws IOException { HttpURLConnection connection = (HttpURLConnection) new URL(this.temporaryGetTSAUrl()).openConnection(); if (this.base64TsaUsrAndPwd != null) {