diff options
author | pdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-11-29 14:32:32 +0000 |
---|---|---|
committer | pdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-11-29 14:32:32 +0000 |
commit | 706da250618d8ac75364388718edff77cd59e3df (patch) | |
tree | 410072d8ea53c8f00011f45c4cf34b15cdc6c37c /src | |
parent | 8c469c56044c7d8694d9e3f58bbd8432588504c1 (diff) | |
download | pdf-as-3-706da250618d8ac75364388718edff77cd59e3df.tar.gz pdf-as-3-706da250618d8ac75364388718edff77cd59e3df.tar.bz2 pdf-as-3-706da250618d8ac75364388718edff77cd59e3df.zip |
improved prepareVerifyRequest to disable "default verify"
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@642 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java index 1d310cf..a111ca5 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java @@ -214,36 +214,39 @@ public class MOASoapWithAttachmentConnector implements Connector return verify_request_xml;
}
- private String chooseAndCreateXMLDsig(SignatureData data, SignSignatureObject so) throws ConnectorException {
+ private String chooseAndCreateXMLDsig(SignatureData data, SignSignatureObject so) throws ConnectorException {
// MOA
- if (SigKZIDHelper.isMOASigned(so)) {
- log.debug("MOA signature detected.");
- return prepareXMLContent(data, so);
-
- // MOCCA
- } else if (SigKZIDHelper.isMOCCASigned(so)) {
- log.debug("MOCCA signature detected.");
- String algorithmId = SigKZIDHelper.parseAlgorithmId(so.id);
- log.debug("Algorithm = " + algorithmId);
- LocRefDetachedMOCCAConnector mocca_connector = new LocRefDetachedMOCCAConnector(this.params, "not needed here", algorithmId);
- return mocca_connector.prepareXMLContent(data, so);
-
- // ATrust
- } else if (SigKZIDHelper.isATrustSigned(so)) {
- log.debug("A-Trust signature detected.");
- this.environment.reInitVerifyTemplate(ATRUST_VERIFY_TEMPLATE_KEY);
- return prepareXMLContent(data, so);
-
- // TD
- } else {
- log.debug("TD signature signature detected.");
- DetachedBKUConnector bku_connector = new DetachedBKUConnector(this.params, "not needed here");
- return bku_connector.prepareXMLContent(data, so);
- }
+ if (SigKZIDHelper.isMOASigned(so)) {
+ log.debug("MOA signature detected.");
+ return prepareXMLContent(data, so);
+
+ // MOCCA
+ } else if (SigKZIDHelper.isMOCCASigned(so)) {
+ log.debug("MOCCA signature detected.");
+ String algorithmId = SigKZIDHelper.parseAlgorithmId(so.id);
+ log.debug("Algorithm = " + algorithmId);
+ LocRefDetachedMOCCAConnector mocca_connector = new LocRefDetachedMOCCAConnector(this.params, "not needed here", algorithmId);
+ return mocca_connector.prepareXMLContent(data, so);
+
+ // ATrust
+ } else if (SigKZIDHelper.isATrustSigned(so)) {
+ log.debug("A-Trust signature detected.");
+ this.environment.reInitVerifyTemplate(ATRUST_VERIFY_TEMPLATE_KEY);
+ return prepareXMLContent(data, so);
+
+ // TD bku
+ } else if (SigKZIDHelper.isBKUSigned(so)) {
+ log.debug("TD bku signature detected.");
+ DetachedBKUConnector bku_connector = new DetachedBKUConnector(this.params, "not needed here");
+ return bku_connector.prepareXMLContent(data, so);
+ } else {
+ throw new ConnectorException(ErrorCode.UNSUPPORTED_SIGNATURE_METHOD, "unsupported signature, get a new pdf-as version. " + so.id + ", " +so.kz);
+
+ }
}
-
-/**
+
+ /**
* Analyzes the verify response string.
*
* @param response_properties
|