diff options
author | Thomas <thomas.lenz@egiz.gv.at> | 2019-12-04 22:54:51 +0100 |
---|---|---|
committer | Thomas <thomas.lenz@egiz.gv.at> | 2019-12-04 22:54:51 +0100 |
commit | 95b21a826e5d81fdeabcf4673a9e87047edaec9d (patch) | |
tree | d8d55da492dd86041c31d68651afa21c80313362 /eaaf_modules/eaaf_module_moa-sig/src/main | |
parent | 759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f (diff) | |
download | EAAF-Components-95b21a826e5d81fdeabcf4673a9e87047edaec9d.tar.gz EAAF-Components-95b21a826e5d81fdeabcf4673a9e87047edaec9d.tar.bz2 EAAF-Components-95b21a826e5d81fdeabcf4673a9e87047edaec9d.zip |
to some more code quality tasks
Diffstat (limited to 'eaaf_modules/eaaf_module_moa-sig/src/main')
4 files changed, 27 insertions, 13 deletions
diff --git a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/api/data/ISchemaRessourceProvider.java b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/api/data/ISchemaRessourceProvider.java index 9bd5791f..49940ca5 100644 --- a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/api/data/ISchemaRessourceProvider.java +++ b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/api/data/ISchemaRessourceProvider.java @@ -17,5 +17,5 @@ public interface ISchemaRessourceProvider { * @return A Set of {@link Entry} consist of Name of the Scheme and XML scheme as * {@link InputStream} */ - public Map<String, InputStream> getSchemas(); + Map<String, InputStream> getSchemas(); } diff --git a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/SignatureCreationService.java b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/SignatureCreationService.java index 5cb001ef..338e77d8 100644 --- a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/SignatureCreationService.java +++ b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/SignatureCreationService.java @@ -18,13 +18,17 @@ public class SignatureCreationService extends AbstractSignatureService private XMLSignatureCreationInvoker xadesInvoker; private CMSSignatureCreationInvoker cadesInvoker; + @PostConstruct protected void internalInitializer() { log.debug("Instanzing SignatureCreationService implementation ... "); xadesInvoker = XMLSignatureCreationInvoker.getInstance(); cadesInvoker = CMSSignatureCreationInvoker.getInstance(); + log.trace("XML_impl: {} , CMS_imp: {}", + xadesInvoker.getClass().getName(), cadesInvoker.getClass().getName()); log.info("MOA-Sig signature-creation service initialized"); + } diff --git a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java index 701e2072..18ee6edb 100644 --- a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java +++ b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java @@ -42,7 +42,10 @@ public class GenericSignatureVerificationResponse @Override public Date getSigningDateTime() { - return this.signingDateTime; + if (this.signingDateTime != null) { + return new Date(this.signingDateTime.getTime()); + } + return null; } @@ -84,7 +87,11 @@ public class GenericSignatureVerificationResponse @Override public byte[] getX509CertificateEncoded() { - return this.getX509CertificateEncoded(); + if (this.x509CertificateEncoded != null) { + return this.x509CertificateEncoded.clone(); + + } + return null; } @@ -101,7 +108,9 @@ public class GenericSignatureVerificationResponse } public void setSigningDateTime(final Date signingDateTime) { - this.signingDateTime = signingDateTime; + if (signingDateTime != null) { + this.signingDateTime = new Date(signingDateTime.getTime()); + } } public void setSignatureCheckCode(final int signatureCheckCode) { @@ -125,7 +134,10 @@ public class GenericSignatureVerificationResponse } public void setX509CertificateEncoded(final byte[] x509CertificateEncoded) { - this.x509CertificateEncoded = x509CertificateEncoded; + if (x509CertificateEncoded != null) { + this.x509CertificateEncoded = x509CertificateEncoded.clone(); + + } } diff --git a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/parser/VerifyXmlSignatureResponseParser.java b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/parser/VerifyXmlSignatureResponseParser.java index 8cf941a7..aa094f1e 100644 --- a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/parser/VerifyXmlSignatureResponseParser.java +++ b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eid/authhandler/modules/sigverify/moasig/impl/parser/VerifyXmlSignatureResponseParser.java @@ -145,15 +145,14 @@ public class VerifyXmlSignatureResponseParser { respData.setPublicAuthority(publicAuthority != null); respData.setPublicAuthorityCode( XPathUtils.getElementValue(verifyXmlSignatureResponse, PUBLIC_AUTHORITY_CODE_XPATH, "")); - respData.setSignatureCheckCode(new Integer( - XPathUtils.getElementValue(verifyXmlSignatureResponse, SIGNATURE_CHECK_CODE_XPATH, "")) - .intValue()); + respData.setSignatureCheckCode(Integer.parseInt( + XPathUtils.getElementValue(verifyXmlSignatureResponse, SIGNATURE_CHECK_CODE_XPATH, ""))); final String xmlDsigCheckCode = XPathUtils.getElementValue(verifyXmlSignatureResponse, XMLDSIG_MANIFEST_CHECK_CODE_XPATH, null); if (xmlDsigCheckCode != null) { respData.setXmlDSIGManigest(true); - respData.setXmlDSIGManifestCheckCode(new Integer(xmlDsigCheckCode).intValue()); + respData.setXmlDSIGManifestCheckCode(Integer.parseInt(xmlDsigCheckCode)); } else { respData.setXmlDSIGManigest(false); @@ -163,12 +162,11 @@ public class VerifyXmlSignatureResponseParser { final String signatureManifestCheckCode = XPathUtils .getElementValue(verifyXmlSignatureResponse, SIGNATURE_MANIFEST_CHECK_CODE_XPATH, null); if (signatureManifestCheckCode != null) { - respData.setSignatureManifestCheckCode(new Integer(signatureManifestCheckCode).intValue()); + respData.setSignatureManifestCheckCode(Integer.parseInt(signatureManifestCheckCode)); } - respData.setCertificateCheckCode(new Integer( - XPathUtils.getElementValue(verifyXmlSignatureResponse, CERTIFICATE_CHECK_CODE_XPATH, "")) - .intValue()); + respData.setCertificateCheckCode(Integer.parseInt( + XPathUtils.getElementValue(verifyXmlSignatureResponse, CERTIFICATE_CHECK_CODE_XPATH, ""))); final String signingTimeElement = XPathUtils.getElementValue(verifyXmlSignatureResponse, SIGNING_TIME_XPATH, ""); |