From 540365f368537e31d19ba86e57dbdfd698df2d52 Mon Sep 17 00:00:00 2001 From: ferbas Date: Tue, 27 Oct 2009 10:53:19 +0000 Subject: parameterized codinghelper with hash method git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@356 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/at/knowcenter/wag/egov/egiz/sig/X509Cert.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/X509Cert.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/X509Cert.java index 8aaa49a..1a2ccbc 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/X509Cert.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/X509Cert.java @@ -324,7 +324,9 @@ public class X509Cert implements Serializable if (certString_ != null) { byte[] cert_b64 = CodingHelper.decodeBase64(certString_); - byte[] cert_hash = CodingHelper.buildDigest(cert_b64); + // dferbas: read digest method from certificate + String digestAlg = this.x509Cert_.getSigAlgName().split("/")[0]; + byte[] cert_hash = CodingHelper.buildDigest(cert_b64, digestAlg); certDigest_ = new String(CodingHelper.encodeBase64(cert_hash)); } } -- cgit v1.2.3