From 7916c117627db0411b35f202f88b2ab6e115361a Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> Date: Fri, 28 Jan 2005 14:10:50 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'MOA-ID-1_20d09'. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/MOA-ID-1_20d09@264 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../XMLSignatureVerificationProfileFactory.java | 147 --------------------- 1 file changed, 147 deletions(-) delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java') diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java deleted file mode 100644 index 858964c82..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java +++ /dev/null @@ -1,147 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.util.ArrayList; -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; -import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -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; - -/** - * 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; - - /** - * Create a new XMLSignatureVerificationProfileFactory. - * - * @param request The VerifyXMLSignatureRequest to extract - * profile data from. - */ - public XMLSignatureVerificationProfileFactory(VerifyXMLSignatureRequest request) { - this.request = request; - } - - /** - * 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. - * @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(); - SignatureManifestCheckParams checkParams; - String trustProfileID; - - // set whether to check XMLDsig manifests - profile.setCheckXMLDsigManifests(true); - - // set the certificate validation profile - trustProfileID = request.getTrustProfileId(); - profile.setCertificateValidationProfile( - new PKIProfileImpl(config, trustProfileID)); - - // set whether hash input data is to be included - profile.setIncludeHashInputData(request.getReturnHashInputData()); - - // set the security layer manifest check parameters - checkParams = request.getSignatureManifestCheckParams(); - if (checkParams != null) { - List transformationSupplements; - - profile.setCheckSecurityLayerManifest(true); - profile.setIncludeReferenceInputData( - checkParams.getReturnReferenceInputData()); - transformationSupplements = buildTransformationSupplements(); - profile.setTransformationSupplements(transformationSupplements); - } else { - profile.setCheckSecurityLayerManifest(false); - profile.setIncludeReferenceInputData(false); - profile.setTransformationSupplements(Collections.EMPTY_LIST); - } - - 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. - * @throws MOAApplicationException An error occurred building one of the - * 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(); - List refInfos = checkParams.getReferenceInfos(); - Iterator refIter; - Iterator prIter; - Iterator trIter; - - // 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(); - - transformsProfiles.addAll( - ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config)); - } - - // build the DataObjects - for (prIter = transformsProfiles.iterator(); prIter.hasNext();) { - VerifyTransformsInfoProfileExplicit profile = - (VerifyTransformsInfoProfileExplicit) prIter.next(); - List transformParameters = profile.getTransformParameters(); - - for (trIter = transformParameters.iterator(); trIter.hasNext();) { - TransformParameter trParam = (TransformParameter) trIter.next(); - transformationSupplements.add( - factory.createFromTransformParameter(trParam)); - } - } - - return transformationSupplements; - } - -} -- cgit v1.2.3