aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov
diff options
context:
space:
mode:
authorferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-02-03 09:18:01 +0000
committerferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-02-03 09:18:01 +0000
commit88d3ce7dff72d1149ac71890db40c39046850377 (patch)
tree73c61e6731cab46135c811a27a6641aaaaa401cd /src/main/java/at/knowcenter/wag/egov
parent84ac01cb59325d664a6d15c2e155a4e17a6c3f4d (diff)
downloadpdf-as-3-88d3ce7dff72d1149ac71890db40c39046850377.tar.gz
pdf-as-3-88d3ce7dff72d1149ac71890db40c39046850377.tar.bz2
pdf-as-3-88d3ce7dff72d1149ac71890db40c39046850377.zip
fixed getCertAlg for old VMs
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@571 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/X509Cert.java6
1 files changed, 5 insertions, 1 deletions
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));
}