From 578ad0d6bc408edf9e6c875156054374f5fd8337 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Mon, 22 Mar 2021 18:40:26 +0100 Subject: change to EGIZ codestyle --- .../XMLSignatureVerificationProfileFactory.java | 103 +++++++++++---------- 1 file changed, 52 insertions(+), 51 deletions(-) (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java') diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java index 3e4c712..7fcd0e9 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.server.invoke; import java.util.ArrayList; @@ -29,8 +28,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; - import at.gv.egovernment.moa.spss.MOAApplicationException; import at.gv.egovernment.moa.spss.MOASystemException; import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; @@ -43,26 +40,29 @@ import at.gv.egovernment.moa.spss.server.iaik.pki.PKIProfileImpl; import at.gv.egovernment.moa.spss.server.iaik.xmlverify.XMLSignatureVerificationProfileImpl; import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; +import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; /** * A factory to create a XMLSignatureVerificationProfile from a * VerifyXMLSignatureRequest, based on the current MOA * configuration. - * + * * @author Patrick Peck * @version $Id$ */ public class XMLSignatureVerificationProfileFactory { - /** The VerifyXMLSignatureRequest for which to create profile - * information. */ - private VerifyXMLSignatureRequest request; + /** + * The VerifyXMLSignatureRequest for which to create profile + * information. + */ + private final VerifyXMLSignatureRequest request; /** * Create a new XMLSignatureVerificationProfileFactory. - * - * @param request The VerifyXMLSignatureRequest to extract - * profile data from. + * + * @param request The VerifyXMLSignatureRequest to extract profile + * data from. */ public XMLSignatureVerificationProfileFactory(VerifyXMLSignatureRequest request) { this.request = request; @@ -71,19 +71,19 @@ public class XMLSignatureVerificationProfileFactory { /** * Create a XMLSignatureCreationProfile from the * VerifyXMLSignaturesRequest and the current MOA configuration. - * + * * @return The XMLSignatureVerificationProfile containing - * additional information for verifying an XML signature. - * @throws MOASystemException A system error occurred building the profile. + * additional information for verifying an XML signature. + * @throws MOASystemException A system error occurred building the profile. * @throws MOAApplicationException An error occurred building the profile. */ public XMLSignatureVerificationProfile createProfile() - throws MOASystemException, MOAApplicationException { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - XMLSignatureVerificationProfileImpl profile = - new XMLSignatureVerificationProfileImpl(); + throws MOASystemException, MOAApplicationException { + final TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + final ConfigurationProvider config = context.getConfiguration(); + final XMLSignatureVerificationProfileImpl profile = + new XMLSignatureVerificationProfileImpl(); SignatureManifestCheckParams checkParams; String trustProfileID; @@ -93,49 +93,50 @@ public class XMLSignatureVerificationProfileFactory { // set the certificate validation profile trustProfileID = request.getTrustProfileId(); profile.setCertificateValidationProfile( - new PKIProfileImpl(config, trustProfileID)); + new PKIProfileImpl(config, trustProfileID)); // set whether hash input data is to be included profile.setIncludeHashInputData(request.getReturnHashInputData()); // set the security layer manifest check parameters - // and transformation supplements (if present) + // and transformation supplements (if present) checkParams = request.getSignatureManifestCheckParams(); profile.setCheckSecurityLayerManifest(true); - profile.setIncludeReferenceInputData(checkParams != null ? checkParams.getReturnReferenceInputData() : false); + profile.setIncludeReferenceInputData(checkParams != null ? checkParams.getReturnReferenceInputData() + : false); if (checkParams != null) { - List transformationSupplements; - transformationSupplements = buildTransformationSupplements(); - profile.setTransformationSupplements(transformationSupplements); + List transformationSupplements; + transformationSupplements = buildTransformationSupplements(); + profile.setTransformationSupplements(transformationSupplements); } else { - profile.setTransformationSupplements(Collections.EMPTY_LIST); + profile.setTransformationSupplements(Collections.EMPTY_LIST); } - + profile.setPermitFileURIs(config.getPermitFileURIs()); - + return profile; } /** * Build supplemental data objects used in the transformations. - * + * * @return A List of DataObjects providing - * supplemental data to the transformations. - * @throws MOASystemException A system error occurred building one of the - * transformations. + * supplemental data to the transformations. + * @throws MOASystemException A system error occurred building one of the + * transformations. * @throws MOAApplicationException An error occurred building one of the - * transformations. + * transformations. */ public List buildTransformationSupplements() - throws MOASystemException, MOAApplicationException { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - SignatureManifestCheckParams checkParams = - request.getSignatureManifestCheckParams(); - List transformsProfiles = new ArrayList(); - List transformationSupplements = new ArrayList(); - DataObjectFactory factory = DataObjectFactory.getInstance(); + throws MOASystemException, MOAApplicationException { + final TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + final ConfigurationProvider config = context.getConfiguration(); + final SignatureManifestCheckParams checkParams = + request.getSignatureManifestCheckParams(); + final List transformsProfiles = new ArrayList(); + final List transformationSupplements = new ArrayList(); + final DataObjectFactory factory = DataObjectFactory.getInstance(); List refInfos = checkParams.getReferenceInfos(); Iterator refIter; Iterator prIter; @@ -144,26 +145,26 @@ public class XMLSignatureVerificationProfileFactory { // build the list of all VerifyTransformsInfoProfiles in all ReferenceInfos refInfos = checkParams.getReferenceInfos(); for (refIter = refInfos.iterator(); refIter.hasNext();) { - ReferenceInfo refInfo = (ReferenceInfo) refIter.next(); - List profiles = refInfo.getVerifyTransformsInfoProfiles(); + final ReferenceInfo refInfo = (ReferenceInfo) refIter.next(); + final List profiles = refInfo.getVerifyTransformsInfoProfiles(); transformsProfiles.addAll( - ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config)); + ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config)); } // build the DataObjects for (prIter = transformsProfiles.iterator(); prIter.hasNext();) { - VerifyTransformsInfoProfileExplicit profile = - (VerifyTransformsInfoProfileExplicit) prIter.next(); - List transformParameters = profile.getTransformParameters(); + final VerifyTransformsInfoProfileExplicit profile = + (VerifyTransformsInfoProfileExplicit) prIter.next(); + final List transformParameters = profile.getTransformParameters(); for (trIter = transformParameters.iterator(); trIter.hasNext();) { - TransformParameter trParam = (TransformParameter) trIter.next(); + final TransformParameter trParam = (TransformParameter) trIter.next(); transformationSupplements.add( - factory.createFromTransformParameter(trParam)); + factory.createFromTransformParameter(trParam)); } } - + return transformationSupplements; } -- cgit v1.2.3