aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-04-21 08:11:48 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-04-21 08:11:48 +0200
commit44d138de959445a619a92608a2133d9558c2a888 (patch)
treebbc9d2f137947afdd6c8697ed9c1c3b71d46fe61 /moaSig/moa-sig-lib/src/main/java/at/gv/egovernment
parente86d9677b16f54850cbd4c91c9f714754a75b67b (diff)
downloadmoa-sig-44d138de959445a619a92608a2133d9558c2a888.tar.gz
moa-sig-44d138de959445a619a92608a2133d9558c2a888.tar.bz2
moa-sig-44d138de959445a619a92608a2133d9558c2a888.zip
publishable moa libraries
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java6
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java5
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java3
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java19
4 files changed, 28 insertions, 5 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java
index 97a2541..cb07b34 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java
@@ -39,6 +39,7 @@ import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent;
import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject;
import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest;
import at.gv.egovernment.moa.spss.api.common.MetaInfo;
+import at.gv.egovernment.moaspss.logging.Logger;
import at.gv.egovernment.moaspss.util.Base64Utils;
import at.gv.egovernment.moaspss.util.CollectionUtils;
import at.gv.egovernment.moaspss.util.Constants;
@@ -61,6 +62,8 @@ public class VerifyCMSSignatureRequestParser {
private static final String DATE_TIME_XPATH = MOA + "DateTime";
private static final String EXTENDED_VALIDATION_XPATH = MOA + "ExtendedValidation";
private static final String CMS_SIGNATURE_XPATH = MOA + "CMSSignature";
+ private static final String PDF_SIGNATURE_XPATH = MOA + "PDFSignature";
+
private static final String TRUST_PROFILE_ID_XPATH = MOA + "TrustProfileID";
private static final String DATA_OBJECT_XPATH = MOA + "DataObject";
private static final String META_INFO_XPATH = MOA + "MetaInfo";
@@ -94,10 +97,11 @@ public class VerifyCMSSignatureRequestParser {
RequestParserUtils.parseExtendedValidation(requestElem, EXTENDED_VALIDATION_XPATH, false);
String cmsSignatureStr =
- XPathUtils.getElementValue(requestElem, CMS_SIGNATURE_XPATH, "");
+ XPathUtils.getElementValue(requestElem, PDF_SIGNATURE_XPATH, "");
CMSDataObject dataObject = parseDataObject(requestElem);
String trustProfileID =
XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null);
+ //Logger.info("CMSSignature: " + cmsSignatureStr);
InputStream cmsSignature =
Base64Utils.decodeToStream(cmsSignatureStr, true);
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java
index 9fda5e0..ab807ae 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java
@@ -55,4 +55,9 @@ public class CMSSignatureVerificationProfileImpl implements CMSSignatureVerifica
this.certificateValidationProfile = certificateValidationProfile;
}
+ @Override
+ public String getTargetLevel() {
+ return CMSSignatureVerificationProfile.LEVEL_LTA;
+ }
+
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
index c49004b..44600db 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
@@ -25,6 +25,7 @@
package at.gv.egovernment.moa.spss.server.iaik.config;
import iaik.cms.IaikCCProvider;
+import iaik.esi.sva.Configuration;
import iaik.pki.store.revocation.RevocationFactory;
import iaik.pki.store.revocation.RevocationSourceStore;
import iaik.pki.store.truststore.TrustStoreFactory;
@@ -83,6 +84,8 @@ public class IaikConfigurator {
try {
TransactionId transId = new TransactionId("IaikConfigurator");
+ //iaik.esi.sva.Configuration config = new Configuration(IaikConfigurator.class.getResourceAsStream("/sva.config"));
+
//SecProviderUtils.dumpSecProviders("Starting configuration");
try {
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
index 906abbe..c48cecd 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
@@ -157,7 +157,7 @@ public class CMSSignatureVerificationInvoker {
.getInstance();
module.setLog(new IaikLog(loggingCtx.getNodeID()));
-
+ //Logger.info(" Available: " + signature.available());
module.init(signature, profile, new TransactionId(context.getTransactionID()));
// input = module.getInputStream();
@@ -254,11 +254,16 @@ public class CMSSignatureVerificationInvoker {
TrustProfile trustProfile) throws MOAException {
QCSSCDResult qcsscdresult = new QCSSCDResult();
+ if(resultObject == null) {
+ Logger.warn("Result Object is null!");
+ return;
+ }
+
CMSSignatureVerificationResult cmsResult = null;
List adesResults = null;
if (resultObject instanceof ExtendedCMSSignatureVerificationResult) {
ExtendedCMSSignatureVerificationResult result = (ExtendedCMSSignatureVerificationResult) resultObject;
-
+ cmsResult = result.getCMSSignatureVerificationResult();
adesResults = getAdESResult(result.getFormVerificationResult());
if (adesResults != null) {
@@ -274,6 +279,7 @@ public class CMSSignatureVerificationInvoker {
String issuerCountryCode = null;
// QC/SSCD check
+ if(cmsResult.getCertificateValidationResult() != null) {
List list = cmsResult.getCertificateValidationResult().getCertificateChain();
if (list != null) {
X509Certificate[] chain = new X509Certificate[list.size()];
@@ -289,7 +295,7 @@ public class CMSSignatureVerificationInvoker {
// get signer certificate issuer country code
issuerCountryCode = CertificateUtils.getIssuerCountry((X509Certificate) list.get(0));
-
+ }
}
responseBuilder.addResult(cmsResult, trustProfile, qcsscdresult.isQC(), qcsscdresult.isQCSourceTSL(),
@@ -347,11 +353,16 @@ public class CMSSignatureVerificationInvoker {
TrustProfile trustProfile) throws MOAException {
QCSSCDResult qcsscdresult = new QCSSCDResult();
+ if(resultObject == null) {
+ Logger.warn("Result Object is null!");
+ return;
+ }
+
PDFSignatureVerificationResult cmsResult = null;
List adesResults = null;
if (resultObject instanceof ExtendedPDFSignatureVerificationResult) {
ExtendedPDFSignatureVerificationResult result = (ExtendedPDFSignatureVerificationResult) resultObject;
-
+ cmsResult = result.getPDFSignatureVerificationResult();
adesResults = getAdESResult(result.getFormVerificationResult());
if (adesResults != null) {