diff options
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/impl')
3 files changed, 17 insertions, 15 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java b/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java index dc6e106..1cb158e 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java @@ -370,9 +370,7 @@ public class PdfAsObject implements PdfAs ReconstructXMLDsigAfterAnalysisParameters reconstructParams,
VerifyAfterAnalysisParameters verifyAfterAnalysisParameters) {
reconstructParams.setAnalyzeResult(verifyAfterAnalysisParameters.getAnalyzeResult());
- reconstructParams.setReturnHashInputData(verifyAfterAnalysisParameters.isReturnHashInputData());
reconstructParams.setSignatureDevice(verifyAfterAnalysisParameters.getSignatureDevice());
- reconstructParams.setVerificationTime(verifyAfterAnalysisParameters.getVerificationTime());
}
/**
@@ -515,20 +513,12 @@ public class PdfAsObject implements PdfAs AnalyzeResult ar = analyze(analyzeParameters);
ReconstructXMLDsigAfterAnalysisParameters rxaap = new ReconstructXMLDsigAfterAnalysisParameters();
- fillReconstructXMLDsigAfterAnalysisParametersWithReconstructXMLDsigParameters(rxaap, reconstructXMLDsigParameters);
+ rxaap.setSignatureDevice(reconstructXMLDsigParameters.getSignatureDevice());
rxaap.setAnalyzeResult(ar);
return reconstructXMLDSIG(rxaap);
}
- protected void fillReconstructXMLDsigAfterAnalysisParametersWithReconstructXMLDsigParameters(
- ReconstructXMLDsigAfterAnalysisParameters rxaap,
- ReconstructXMLDsigParameters reconstructXMLDsigParameters) {
- rxaap.setReturnHashInputData(reconstructXMLDsigParameters.isReturnHashInputData());
- rxaap.setSignatureDevice(reconstructXMLDsigParameters.getSignatureDevice());
- rxaap.setVerificationTime(reconstructXMLDsigParameters.getVerificationTime());
- }
-
/**
* @see PdfAs#reconstructXMLDSIG(ReconstructXMLDsigAfterAnalysisParameters)
*/
@@ -579,7 +569,7 @@ public class PdfAsObject implements PdfAs ExtendedSignatureInformation extSigInfo = (ExtendedSignatureInformation)extSignatures.get(i);
SignatureHolder holder = (SignatureHolder) extSigInfo.getSignatureInformation().getInternalSignatureInformation();
- VerifyResult vr = new VerifyResultAdapter(response, holder, verifyAfterReconstructXMLDsigParameters.getVerificationTime());
+ VerifyResult vr = new VerifyResultAdapter(response, holder, verifyAfterReconstructXMLDsigParameters.getVerificationTime(), extSigInfo.getXmlDsigData());
vr.setNonTextualObjects( extSigInfo.getSignatureInformation().getNonTextualObjects());
vrs.add(vr);
@@ -589,7 +579,7 @@ public class PdfAsObject implements PdfAs ExtendedSignatureInformation extSigInfo = (ExtendedSignatureInformation)extSignatures.get(verifySignatureIndex);
SignatureHolder holder = (SignatureHolder) extSigInfo.getSignatureInformation().getInternalSignatureInformation();
- VerifyResult vr = new VerifyResultAdapter(response, holder, verifyAfterReconstructXMLDsigParameters.getVerificationTime());
+ VerifyResult vr = new VerifyResultAdapter(response, holder, verifyAfterReconstructXMLDsigParameters.getVerificationTime(), extSigInfo.getXmlDsigData());
vr.setNonTextualObjects( extSigInfo.getSignatureInformation().getNonTextualObjects());
vrs.add(vr);
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/internal/PdfAsInternalObject.java b/src/main/java/at/gv/egiz/pdfas/impl/api/internal/PdfAsInternalObject.java index 4e36c24..747f6b0 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/api/internal/PdfAsInternalObject.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/api/internal/PdfAsInternalObject.java @@ -272,7 +272,7 @@ public class PdfAsInternalObject implements PdfAsInternal { Properties props = new Properties();
props.setProperty(BKUPostConnection.RESPONSE_STRING_KEY, xmlResponse);
SignatureResponse sigResponse = local_conn.analyzeVerifyResponse(props);
- return new VerifyResultAdapter(sigResponse, holder, null);
+ return new VerifyResultAdapter(sigResponse, holder, null, null); // timestamp and xmldsig not needed here
}
/**
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/verify/VerifyResultAdapter.java b/src/main/java/at/gv/egiz/pdfas/impl/api/verify/VerifyResultAdapter.java index b640bc7..265c916 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/api/verify/VerifyResultAdapter.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/api/verify/VerifyResultAdapter.java @@ -14,6 +14,7 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
import at.gv.egiz.pdfas.api.verify.SignatureCheck;
import at.gv.egiz.pdfas.api.verify.VerifyResult;
+import at.gv.egiz.pdfas.api.xmldsig.XMLDsigData;
import at.gv.egiz.pdfas.impl.api.commons.SignatureInformationAdapter;
import at.knowcenter.wag.egov.egiz.exceptions.SettingNotFoundException;
import at.knowcenter.wag.egov.egiz.pdf.BinarySignatureHolder;
@@ -38,6 +39,8 @@ public class VerifyResultAdapter extends SignatureInformationAdapter implements protected Date vTime = null;
private String timestamp;
+
+ private XMLDsigData xmlDsigData;
/**
@@ -49,12 +52,14 @@ public class VerifyResultAdapter extends SignatureInformationAdapter implements * The SignatureHolder.
* @param verificationTime
* The time of verification. This is directly returned by {@link #getVerificationTime()}
+ * @param xmlDsigData
*/
- public VerifyResultAdapter(SignatureResponse sigRes, SignatureHolder sh, Date verificationTime)
+ public VerifyResultAdapter(SignatureResponse sigRes, SignatureHolder sh, Date verificationTime, XMLDsigData xmlDsigData)
{
super(sh);
this.sigRes = sigRes;
this.vTime = verificationTime;
+ this.xmlDsigData = xmlDsigData;
if (sh instanceof BinarySignatureHolder) {
this.timestamp = ((BinarySignatureHolder)sh).getSignatureObject().getTimeStamp();
}
@@ -169,5 +174,12 @@ public class VerifyResultAdapter extends SignatureInformationAdapter implements public boolean isVerificationDone() {
return this.sigRes.getVerificationImpossibleEx() == null;
}
+
+ /**
+ * @see VerifyResult#getReconstructedXMLDsig()
+ */
+ public XMLDsigData getReconstructedXMLDsig() {
+ return this.xmlDsigData;
+ }
}
|