From 88d3ce7dff72d1149ac71890db40c39046850377 Mon Sep 17 00:00:00 2001 From: ferbas Date: Wed, 3 Feb 2010 09:18:01 +0000 Subject: fixed getCertAlg for old VMs git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@571 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/at/knowcenter/wag/egov/egiz/sig/X509Cert.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/at') 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 b18b7ac..fbd89fa 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 @@ -325,7 +325,11 @@ public class X509Cert implements Serializable { byte[] cert_b64 = CodingHelper.decodeBase64(certString_); // dferbas: read digest method from certificate - String digestAlg = this.x509Cert_.getSigAlgName().split("/")[0]; + String sigAlgName = this.x509Cert_.getSigAlgName(); + String digestAlg = sigAlgName.split("/")[0]; + if (sigAlgName.toLowerCase().indexOf("with") != -1 ) { + digestAlg = sigAlgName.substring(0,sigAlgName.toLowerCase().indexOf("with")); + } byte[] cert_hash = CodingHelper.buildDigest(cert_b64, digestAlg); certDigest_ = new String(CodingHelper.encodeBase64(cert_hash)); } -- cgit v1.2.3