aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2015-04-23 17:57:17 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2015-04-23 17:57:17 +0200
commitfab73b839be7c1ae0e003954630f88262927d886 (patch)
tree3b444f796de755ee31357c01580fe97f8c6a89b9 /pdf-as-lib
parent5e0264a94511844742b09eb4c61940e8b4e10fbd (diff)
downloadpdf-as-3-fab73b839be7c1ae0e003954630f88262927d886.tar.gz
pdf-as-3-fab73b839be7c1ae0e003954630f88262927d886.tar.bz2
pdf-as-3-fab73b839be7c1ae0e003954630f88262927d886.zip
retry on possible worng X14 MOA ID
Diffstat (limited to 'pdf-as-lib')
-rw-r--r--pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java
index 3f24ec1..dd13908 100644
--- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java
+++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java
@@ -192,13 +192,34 @@ public class MOASoapWithAttachmentConnector implements Connector {
String verify_request_xml = prepareVerifyRequest(data, so, dsig);
log.debug("verify_request_xml = " + verify_request_xml); //$NON-NLS-1$
-
+ log.debug("ID: " + so.id);
String url = this.environment.getVerifyURL();
Properties response_properties = sendRequest(url,
MOASoapConnection.SERVICE_VERIFY, verify_request_xml, data);
SignatureResponse signature_response = analyzeVerifyResponse(response_properties);
+ if("2".equals(signature_response.getSignatureCheckCode()) &&
+ so.id != null && so.id.startsWith(DetachedLocRefMOAIdFormatter.SIG_ID_PREFIX)) {
+ log.debug("Retrying using X14 for MOA");
+
+ so.id = DetachedLocRefMOAIdFormatter.SIG_ID_X14_PREFIX;
+
+ verify_request_xml = prepareVerifyRequest(data, so, dsig);
+ log.debug("verify_request_xml = " + verify_request_xml); //$NON-NLS-1$
+ log.debug("ID: " + so.id);
+ url = this.environment.getVerifyURL();
+ response_properties = sendRequest(url,
+ MOASoapConnection.SERVICE_VERIFY, verify_request_xml, data);
+
+ SignatureResponse signature_response2 = analyzeVerifyResponse(response_properties);
+
+ if("0".equals(signature_response2.getSignatureCheckCode())) {
+ log.debug("doVerify finished."); //$NON-NLS-1$
+ return signature_response2;
+ }
+ }
+
log.debug("doVerify finished."); //$NON-NLS-1$
return signature_response;
}