diff options
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api')
161 files changed, 4872 insertions, 4779 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java index 59db7b5..f2d3b89 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java @@ -21,17 +21,17 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api; import at.gv.egovernment.moa.spss.MOAException; import at.gv.egovernment.moa.spss.server.init.ConfiguratorImpl; +import at.gv.egovernment.moa.spss.server.init.StartupConfigurationHolder; /** * Configures the SP/SS API. - * - * Also handles dynamic configuration updates. - * + * + * Also handles dynamic configuration updates. + * * @author Patrick Peck * @version $Id$ */ @@ -39,7 +39,7 @@ public abstract class Configurator { /** The default implementation class. */ private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.server.init.ConfiguratorImpl"; + "at.gv.egovernment.moa.spss.server.init.ConfiguratorImpl"; /** The single instance of this class. */ private static Configurator instance = null; @@ -47,14 +47,13 @@ public abstract class Configurator { public static synchronized Configurator getInstance() { if (instance == null) { try { - /*DiscoverClass discover = new DiscoverClass(); - instance = - (Configurator) discover.newInstance( - Configurator.class, - DEFAULT_IMPLEMENTATION);*/ - instance = new ConfiguratorImpl(); - } catch (Exception e) { - // this can not happen since we provide a valid default + /* + * DiscoverClass discover = new DiscoverClass(); instance = (Configurator) + * discover.newInstance( Configurator.class, DEFAULT_IMPLEMENTATION); + */ + instance = new ConfiguratorImpl(); + } catch (final Exception e) { + // this can not happen since we provide a valid default // implementation } } @@ -62,23 +61,35 @@ public abstract class Configurator { } /** + * Get current configuration object. + * + * @return Configuration or <code>null</code> if it was not initialized yet + */ + public abstract StartupConfigurationHolder getCurrentConfiguration(); + + /** * Initialize the SP/SS configuration. - * - * Only a single call to this method will have an effect. Use - * <code>update()</code> for reflecting changes in the configuration instead. - * + * + * Only a single call to this method will have an effect. Use + * <code>update()</code> for reflecting changes in the configuration instead. + * + * @return Configuration holder + * * @throws MOAException An error occurred updating the SP/SS configuration. - */ - public abstract void init() throws MOAException; - + */ + public abstract StartupConfigurationHolder init() throws MOAException; + /** * Update the SP/SS configuration. - * + * * This will only have an effect after the system has been initialized once * using <code>init()</code>. - * + * + * @return Updated Configuration holder, or <code>null</code> if it was not + * initialized + * * @throws MOAException An error occurred updating the SP/SS configuration. */ - public abstract void update() throws MOAException; + public abstract StartupConfigurationHolder update() throws MOAException; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SPSSFactory.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SPSSFactory.java index d7cd10c..d0be7d5 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SPSSFactory.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SPSSFactory.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api; import java.io.InputStream; @@ -81,10 +80,10 @@ import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; /** * An abstract factory for creating MOA SP/SS API objects. - * - * Use <code>getInstance()</code> to get a concrete factory instance. Using - * this instance, concrete MOA SP/SS API object can be created. - * + * + * Use <code>getInstance()</code> to get a concrete factory instance. Using this + * instance, concrete MOA SP/SS API object can be created. + * * @author Patrick Peck * @author Gregor Karlinger * @version $Id$ @@ -93,27 +92,26 @@ public abstract class SPSSFactory { /** The default implementation of this class. */ private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.api.impl.SPSSFactoryImpl"; + "at.gv.egovernment.moa.spss.api.impl.SPSSFactoryImpl"; /** The single instance of this class. */ private static SPSSFactory instance = null; /** * Returns the single instance of this class. - * + * * @return The single instance of this class. */ public static synchronized SPSSFactory getInstance() { if (instance == null) { try { - /*DiscoverClass discover = new DiscoverClass(); - instance = - (SPSSFactory) discover.newInstance( - SPSSFactory.class, - DEFAULT_IMPLEMENTATION);*/ + /* + * DiscoverClass discover = new DiscoverClass(); instance = (SPSSFactory) + * discover.newInstance( SPSSFactory.class, DEFAULT_IMPLEMENTATION); + */ instance = new SPSSFactoryImpl(); - } catch (Exception e) { - // this can not happen since we provide a valid default + } catch (final Exception e) { + // this can not happen since we provide a valid default // implementation } } @@ -126,94 +124,94 @@ public abstract class SPSSFactory { /** * Create a new <code>CreateXMLSignatureRequest</code> object. - * - * @param keyIdentifier The identifier for the key group to use for signing. - * @param singleSignatureInfos A <code>List</code> of - * <code>SingleSignatureInfo</code> objects containing information about a - * single signature to be created. - * @return The <code>CreateXMLSignatureRequest</code> containing the above - * data. - * + * + * @param keyIdentifier The identifier for the key group to use for + * signing. + * @param singleSignatureInfos A <code>List</code> of + * <code>SingleSignatureInfo</code> objects + * containing information about a single signature + * to be created. + * @return The <code>CreateXMLSignatureRequest</code> containing the above data. + * * @pre keyIdentifier != null && keyIdentifier.length() > 0 * @pre singleSignatureInfos != null - * @pre forall Object o in singleSignatureInfos | - * o instanceof at.gv.egovernment.moa.spss.api.common.SingleSignatureInfo + * @pre forall Object o in singleSignatureInfos | o instanceof + * at.gv.egovernment.moa.spss.api.common.SingleSignatureInfo * @post return != null */ public abstract CreateXMLSignatureRequest createCreateXMLSignatureRequest( - String keyIdentifier, - List singleSignatureInfos); + String keyIdentifier, + List singleSignatureInfos); /** * Create a new <code>CreateCMSSignatureRequest</code> object. - * - * @param keyIdentifier The identifier for the key group to use for signing. - * @param singleSignatureInfos A <code>List</code> of - * <code>SingleSignatureInfo</code> objects containing information about a - * single signature to be created. - * @return The <code>CreateCMSSignatureRequest</code> containing the above - * data. - * + * + * @param keyIdentifier The identifier for the key group to use for + * signing. + * @param singleSignatureInfos A <code>List</code> of + * <code>SingleSignatureInfo</code> objects + * containing information about a single signature + * to be created. + * @return The <code>CreateCMSSignatureRequest</code> containing the above data. + * * @pre keyIdentifier != null && keyIdentifier.length() > 0 * @pre singleSignatureInfos != null - * @pre forall Object o in singleSignatureInfos | - * o instanceof at.gv.egovernment.moa.spss.api.common.SingleSignatureInfo + * @pre forall Object o in singleSignatureInfos | o instanceof + * at.gv.egovernment.moa.spss.api.common.SingleSignatureInfo * @post return != null */ public abstract CreateCMSSignatureRequest createCreateCMSSignatureRequest( - String keyIdentifier, - List singleSignatureInfos); - + String keyIdentifier, + List singleSignatureInfos); + /** * Create a new <code>SingleSignatureInfo</code> object. - * - * @param dataObjectInfos The data objects that will be signed (including - * transformations). - * @param createSignatureInfo Information about the signature environment. May - * be <code>null</code>. + * + * @param dataObjectInfos The data objects that will be signed (including + * transformations). + * @param createSignatureInfo Information about the signature environment. May + * be <code>null</code>. * @param securityLayerConform If <code>true</code>, a Security Layer conform - * signature manifest is created, otherwise not. + * signature manifest is created, otherwise not. * @return The <code>SingleSignatureInfo</code> containing the above data. - * + * * @pre dataObjectInfos != null && dataObjectInfos.size() > 0 - * @pre forall Object o in dataObjectInfos | - * o instanceof at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo + * @pre forall Object o in dataObjectInfos | o instanceof + * at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo * @post return != null */ public abstract SingleSignatureInfo createSingleSignatureInfo( - List dataObjectInfos, - CreateSignatureInfo createSignatureInfo, boolean securityLayerConform); - + List dataObjectInfos, + CreateSignatureInfo createSignatureInfo, boolean securityLayerConform); + /** * Create a new <code>SingleSignatureInfo</code> object. - * - * @param dataObjectInfo The data object that will be signed. + * + * @param dataObjectInfo The data object that will be signed. * @param securityLayerConform If <code>true</code>, a Security Layer conform - * signature manifest is created, otherwise not. - * @param isPAdESSignature + * signature manifest is created, otherwise not. + * @param isPAdESSignature * @return The <code>SingleSignatureInfo</code> containing the above data. - * + * * @post return != null */ - public abstract at.gv.egovernment.moa.spss.api.cmssign.SingleSignatureInfo createSingleSignatureInfoCMS( - at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo dataObjectInfo, - boolean securityLayerConform, boolean isPAdESSignature); - - - + public abstract at.gv.egovernment.moa.spss.api.cmssign.SingleSignatureInfo createSingleSignatureInfoCMS( + at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo dataObjectInfo, + boolean securityLayerConform, boolean isPAdESSignature); /** * Create a new <code>DataObjectInfo</code> object. - * - * @param structure The type of signature to create. - * @param childOfManifest If <code>true</code>, references will be returned - * as children of an XMLDsig manifest. Otherwise, they will be returned as - * children of the signature itself. - * @param dataObject The data object that will be signed. - * @param createTransformsInfoProfile Additional transformations to apply - * to the data object. + * + * @param structure The type of signature to create. + * @param childOfManifest If <code>true</code>, references will be + * returned as children of an XMLDsig + * manifest. Otherwise, they will be returned + * as children of the signature itself. + * @param dataObject The data object that will be signed. + * @param createTransformsInfoProfile Additional transformations to apply to the + * data object. * @return The <code>DataObjectInfo</code> containing the above data. - * + * * @pre DataObjectInfo.STRUCTURE_DETACHED.equals(structure) || * DataObjectInfo.STRUCTURE_ENVELOPING.equals(structure) * @pre dataObject != null @@ -221,218 +219,216 @@ public abstract class SPSSFactory { * @post return != null */ public abstract DataObjectInfo createDataObjectInfo( - String structure, - boolean childOfManifest, - Content dataObject, - CreateTransformsInfoProfile createTransformsInfoProfile); + String structure, + boolean childOfManifest, + Content dataObject, + CreateTransformsInfoProfile createTransformsInfoProfile); /** * Create a new <code>DataObjectInfo</code> object. - * - * @param structure The type of signature to create. + * + * @param structure The type of signature to create. * @param dataObject The data object that will be signed. * @return The <code>DataObjectInfo</code> containing the above data. - * + * * @pre DataObjectInfo.STRUCTURE_DETACHED.equals(structure) || * DataObjectInfo.STRUCTURE_ENVELOPING.equals(structure) * @pre dataObject != null * @post return != null */ public abstract at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo createDataObjectInfo( - String structure, - CMSDataObject dataObject); - + String structure, + CMSDataObject dataObject); + /** * Create a new <code>CreateTransformsInfoProfile</code> object containing a * reference to a locally stored profile. - * - * @param profileID The profile ID to resolve during signature creation. + * + * @param profileID The profile ID to resolve during signature creation. * @return The <code>CreateTransformsInfoProfile</code> containing the given - * profile ID. - * + * profile ID. + * * @pre profileID != null && profileID.length() > 0 * @post return != null */ public abstract CreateTransformsInfoProfile createCreateTransformsInfoProfile(String profileID); /** - * Create a new <code>CreateTransformsInfoProfile</code> object by providing - * the profile data explicitly. - * - * @param transformsInfo The transformations to apply to the associated - * data object. - * @param supplements Supplemental information for the transformation. May be - * <code>null</code>. + * Create a new <code>CreateTransformsInfoProfile</code> object by providing the + * profile data explicitly. + * + * @param transformsInfo The transformations to apply to the associated data + * object. + * @param supplements Supplemental information for the transformation. May be + * <code>null</code>. * @return The <code>CreateTransformsInfoProfile</code> containing the above - * data. - * + * data. + * * @pre transformsInfo != null - * @pre supplements != null implies - * forall Object o in supplements | - * o instanceof at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation + * @pre supplements != null implies forall Object o in supplements | o + * instanceof + * at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation * @post return != null */ public abstract CreateTransformsInfoProfile createCreateTransformsInfoProfile( - CreateTransformsInfo transformsInfo, - List supplements); + CreateTransformsInfo transformsInfo, + List supplements); /** * Create a new <code>CreateTransformsInfo</code> object. - * - * @param transforms The <code>Transform</code>s to apply to the associated - * data object. May be <code>null</code>. - * @param finalDataMetaInfo Information about the type of the transformed - * data. + * + * @param transforms The <code>Transform</code>s to apply to the + * associated data object. May be <code>null</code>. + * @param finalDataMetaInfo Information about the type of the transformed data. * @return The <code>CreateTransformsInfo</code> containing the above data. - * + * * @pre transforms != null implies transforms.size > 0 - * @pre transforms != null implies - * forall Object o in transforms | - * o instanceof at.gv.egovernment.moa.spss.api.common.Transform + * @pre transforms != null implies forall Object o in transforms | o instanceof + * at.gv.egovernment.moa.spss.api.common.Transform * @pre finalDataMetaInfo != null * @post return != null */ public abstract CreateTransformsInfo createCreateTransformsInfo( - List transforms, - MetaInfo finalDataMetaInfo); + List transforms, + MetaInfo finalDataMetaInfo); /** * Create a new <code>CreateSignatureInfo</code> object. - * - * @param createSignatureEnvironment The signature environment that will - * contain the signature. - * @param createSignatureEnvironmentProfile Additional information about - * the signture environment. + * + * @param createSignatureEnvironment The signature environment that will + * contain the signature. + * @param createSignatureEnvironmentProfile Additional information about the + * signture environment. * @return The <code>CreateSignatureInfo</code> containing the above data. - * + * * @pre createSignatureEnvironment != null * @pre createSignatureEnvironmentProfile != null * @post return != null */ public abstract CreateSignatureInfo createCreateSignatureInfo( - Content createSignatureEnvironment, - CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile); + Content createSignatureEnvironment, + CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile); /** - * Create a new <code>CreateSignatureEnvironmentProfile</code> object - * containing a reference to a locally stored profile. - * + * Create a new <code>CreateSignatureEnvironmentProfile</code> object containing + * a reference to a locally stored profile. + * * @param profileID The profile ID to resolve during signature creation. - * @return The <code>CreateSignatureEnvironmentProfile</code> containing - * the given profile ID. - * + * @return The <code>CreateSignatureEnvironmentProfile</code> containing the + * given profile ID. + * * @pre profileID != null && profileID.length() > 0 * @post return != null */ public abstract CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile(String profileID); /** - * Create a new <code>CreateSignatureEnvironmentProfile</code> object by - * providing the profile data explicitly. - * + * Create a new <code>CreateSignatureEnvironmentProfile</code> object by + * providing the profile data explicitly. + * * @param createSignatureLocation The location where the signature will be - * inserted. - * @param supplements Additional information about the signature environment. + * inserted. + * @param supplements Additional information about the signature + * environment. * @return The <code>CreateSignatureEnvironmentProfile</code> containing the - * above data. - * + * above data. + * * @pre createSignatureLocation != null - * @pre supplements != null - * @pre forall Object o in supplements | - * o instanceof at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation + * @pre supplements != null + * @pre forall Object o in supplements | o instanceof + * at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation * @post return != null */ public abstract CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile( - CreateSignatureLocation createSignatureLocation, - List supplements); + CreateSignatureLocation createSignatureLocation, + List supplements); /** * Create a new <code>CreateSignatureLocation</code> object. - * - * @param xPathExpression The XPath expression to select the signature - * parent element within the signature environment. - * @param index The index of the node, after which the signature will be - * inserted. + * + * @param xPathExpression The XPath expression to select the signature + * parent element within the signature environment. + * @param index The index of the node, after which the signature + * will be inserted. * @param namespaceDeclarations The namespace prefix to URI mapping to apply - * while evaluating the XPath expression. + * while evaluating the XPath expression. * @return The <code>CreateSignatureLocation</code> containing the above data. - * + * * @pre xPathExpression != null * @pre index >= 0 * @pre namespaceDeclarations != null */ public abstract CreateSignatureLocation createCreateSignatureLocation( - String xPathExpression, - int index, - Map namespaceDeclarations); + String xPathExpression, + int index, + Map namespaceDeclarations); /** * Create a new <code>CreateXMLSignatureResponse</code> object. - * - * @param responseElements The elements of the response, either - * <code>SignatureEnvironmentResponse</code> objects, or - * <code>ErrorResponse</code> objects. - * @return The new <code>CreateXMLSignatureResponse</code> containing the - * above data. - * + * + * @param responseElements The elements of the response, either + * <code>SignatureEnvironmentResponse</code> objects, or + * <code>ErrorResponse</code> objects. + * @return The new <code>CreateXMLSignatureResponse</code> containing the above + * data. + * * @pre responseElements != null && responseElements.size() > 0 - * @pre forall Object o in responseElements | - * o instanceof at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureResponseElement + * @pre forall Object o in responseElements | o instanceof + * at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureResponseElement * @post return != null */ public abstract CreateXMLSignatureResponse createCreateXMLSignatureResponse(List responseElements); - /** * Create a new <code>CreateCMSSignatureResponse</code> object. - * - * @param responseElements The elements of the response, either - * <code>CMSSignatureResponse</code> objects, or - * <code>ErrorResponse</code> objects. - * @return The new <code>CreateCMSSignatureResponse</code> containing the - * above data. - * + * + * @param responseElements The elements of the response, either + * <code>CMSSignatureResponse</code> objects, or + * <code>ErrorResponse</code> objects. + * @return The new <code>CreateCMSSignatureResponse</code> containing the above + * data. + * * @pre responseElements != null && responseElements.size() > 0 - * @pre forall Object o in responseElements | - * o instanceof at.gv.egovernment.moa.spss.api.cmssign.CMSSignatureResponse + * @pre forall Object o in responseElements | o instanceof + * at.gv.egovernment.moa.spss.api.cmssign.CMSSignatureResponse * @post return != null */ public abstract CreateCMSSignatureResponse createCreateCMSSignatureResponse(List responseElements); - - + /** * Create a new <code>SignatureEnvironmentResponse</code> object. - * + * * @param signatureEnvironment The signature environment containing the - * signature. + * signature. * @return The <code>SignatureEnvironmentResponse</code> containing the - * <code>signatureEnvironment</code>. - * + * <code>signatureEnvironment</code>. + * * @pre signatureEnvironment != null * @post return != null */ public abstract CMSSignatureResponse createCMSSignatureResponse(String base64value); - + /** * Create a new <code>SignatureEnvironmentResponse</code> object. - * + * * @param signatureEnvironment The signature environment containing the - * signature. + * signature. * @return The <code>SignatureEnvironmentResponse</code> containing the - * <code>signatureEnvironment</code>. - * + * <code>signatureEnvironment</code>. + * * @pre signatureEnvironment != null * @post return != null */ - public abstract SignatureEnvironmentResponse createSignatureEnvironmentResponse(Element signatureEnvironment); + public abstract SignatureEnvironmentResponse createSignatureEnvironmentResponse( + Element signatureEnvironment); /** * Create a new <code>ErrorResponse</code> object. - * + * * @param code The numerical error code. * @param info Verbose error information. * @return The new <code>ErrorResponse</code> containing the above data. - * + * * @pre code > 0 * @pre info != null * @post return != null @@ -445,91 +441,87 @@ public abstract class SPSSFactory { /** * Create a new <code>VerifyCMSSignatureRequest</code> object. - * - * @param signatories The indexes of the signatories whose signature is to - * be verified. - * @param dateTime The date for which the verification is to be performed. - * May be <code>null</code>. - * @param cmsSignature The CMS signature. - * @param dataObject The signed data. May be <code>null</code>. - * @param trustProfileID The ID of the trust profile containing the trusted - * root certificates. - * @return The <code>VerifyCMSSignatureRequest</code> containing the above - * data. - * + * + * @param signatories The indexes of the signatories whose signature is to be + * verified. + * @param dateTime The date for which the verification is to be performed. + * May be <code>null</code>. + * @param cmsSignature The CMS signature. + * @param dataObject The signed data. May be <code>null</code>. + * @param trustProfileID The ID of the trust profile containing the trusted root + * certificates. + * @return The <code>VerifyCMSSignatureRequest</code> containing the above data. + * * @pre signatories != null && signatories.length > 0 - * @pre signaturies != VerifyCMSSignatureRequest.ALL_SIGNATORIES implies - * for (int i = 0; i < signatories.length; i++) - * signatories[i] >= 1 + * @pre signaturies != VerifyCMSSignatureRequest.ALL_SIGNATORIES implies for + * (int i = 0; i < signatories.length; i++) signatories[i] >= 1 * @pre cmsSignature != null * @pre trustProfileID != null && trustProfileID.length() > 0 * @post return != null */ public abstract VerifyCMSSignatureRequest createVerifyCMSSignatureRequest( - int[] signatories, - Date dateTime, - InputStream cmsSignature, - CMSDataObject dataObject, - String trustProfileID, - boolean pdf); - + int[] signatories, + Date dateTime, + InputStream cmsSignature, + CMSDataObject dataObject, + String trustProfileID, + boolean pdf); + /** * Create a new <code>VerifyCMSSignatureRequest</code> object. - * - * @param signatories The indexes of the signatories whose signature is to - * be verified. - * @param dateTime The date for which the verification is to be performed. - * May be <code>null</code>. - * @param cmsSignature The CMS signature. - * @param dataObject The signed data. May be <code>null</code>. - * @param trustProfileID The ID of the trust profile containing the trusted - * root certificates. - * @return The <code>VerifyCMSSignatureRequest</code> containing the above - * data. - * + * + * @param signatories The indexes of the signatories whose signature is to be + * verified. + * @param dateTime The date for which the verification is to be performed. + * May be <code>null</code>. + * @param cmsSignature The CMS signature. + * @param dataObject The signed data. May be <code>null</code>. + * @param trustProfileID The ID of the trust profile containing the trusted root + * certificates. + * @return The <code>VerifyCMSSignatureRequest</code> containing the above data. + * * @pre signatories != null && signatories.length > 0 - * @pre signaturies != VerifyCMSSignatureRequest.ALL_SIGNATORIES implies - * for (int i = 0; i < signatories.length; i++) - * signatories[i] >= 1 + * @pre signaturies != VerifyCMSSignatureRequest.ALL_SIGNATORIES implies for + * (int i = 0; i < signatories.length; i++) signatories[i] >= 1 * @pre cmsSignature != null * @pre trustProfileID != null && trustProfileID.length() > 0 * @post return != null */ public abstract VerifyCMSSignatureRequest createVerifyCMSSignatureRequest( - int[] signatories, - Date dateTime, - InputStream cmsSignature, - CMSDataObject dataObject, - String trustProfileID, - boolean pdf, - boolean extended); + int[] signatories, + Date dateTime, + InputStream cmsSignature, + CMSDataObject dataObject, + String trustProfileID, + boolean pdf, + boolean extended); /** * Create a new <code>CMSDataObject</code> object from data at a given URI. - * - * @param metaInfo Type information about the <code>CMSDataObject</code>. - * May be <code>null</code>. - * @param content The CMS content containing the data. + * + * @param metaInfo Type information about the <code>CMSDataObject</code>. May be + * <code>null</code>. + * @param content The CMS content containing the data. * @return The new <code>CMSDataObject</code> containing the data. - * + * * @pre referenceURI != null * @pre content != null * @post return != null */ public abstract CMSDataObject createCMSDataObject( - MetaInfo metaInfo, - CMSContent content, - BigDecimal excludeByteRangeFrom, - BigDecimal excludeByteRangeTo); + MetaInfo metaInfo, + CMSContent content, + BigDecimal excludeByteRangeFrom, + BigDecimal excludeByteRangeTo); /** * Create a new <code>CMSContent</code> object from the data contained at the * given URI. - * + * * @param referenceURI The URI identifying the data. Must be resolvable. * @return The <code>CMSContent</code> containing a reference to the signed - * data. - * + * data. + * * @pre referenceURI != null * @post return != null */ @@ -537,11 +529,11 @@ public abstract class SPSSFactory { /** * Create a new <code>CMSContent</code> object from a byte stream. - * + * * @param binaryContent The byte stream containing the signed data. - * @return The new <code>CMSContent</code> containing the data from the - * byte stream. - * + * @return The new <code>CMSContent</code> containing the data from the byte + * stream. + * * @pre binaryContent != null * @post return != null */ @@ -549,41 +541,40 @@ public abstract class SPSSFactory { /** * Create a new <code>VerifyCMSSignatureResponse</code> object. - * + * * @param responseElements Verification information about each signature. - * @return The new <code>VerifyCMSSignatureResponse</code> containing the - * status of signature verification for each signature contained in the - * request. - * - * @pre responseElements != null && responseElements.size() > 0 - * @pre forall Object o in responseElements | - * o instanceof at.gv.egovernment.moa.spss.api.cmssign.VerifyCMSSignatureResponseElement + * @return The new <code>VerifyCMSSignatureResponse</code> containing the status + * of signature verification for each signature contained in the + * request. + * + * @pre responseElements != null && responseElements.size() > 0 + * @pre forall Object o in responseElements | o instanceof + * at.gv.egovernment.moa.spss.api.cmssign.VerifyCMSSignatureResponseElement * @post return != null */ public abstract VerifyCMSSignatureResponse createVerifyCMSSignatureResponse(List responseElements); /** * Create a new <code>VerifyCMSSignatureResponseElement</code> object. - * - * @param signerInfo Information about the signer certificate. - * @param signatureCheck Result of the signature value check. + * + * @param signerInfo Information about the signer certificate. + * @param signatureCheck Result of the signature value check. * @param certificateCheck Result of the certificate status check. - * @return The new <code>VerifyCMSSignatureResponseElement</code> containing - * the above data. - * - * @pre signerInfo != null && signatureCheck != null && - * certificateCheck != null + * @return The new <code>VerifyCMSSignatureResponseElement</code> containing the + * above data. + * + * @pre signerInfo != null && signatureCheck != null && certificateCheck != null * @post return != null */ public abstract VerifyCMSSignatureResponseElement createVerifyCMSSignatureResponseElement( - SignerInfo signerInfo, - CheckResult signatureCheck, - CheckResult certificateCheck, - List adesResult, - ExtendedCertificateCheckResult extendedCertificateCheckResult, - String usedAlgorithm, - Boolean coversFullDocument, - int[] byteRangeOfSignature); + SignerInfo signerInfo, + CheckResult signatureCheck, + CheckResult certificateCheck, + List adesResult, + ExtendedCertificateCheckResult extendedCertificateCheckResult, + String usedAlgorithm, + Boolean coversFullDocument, + int[] byteRangeOfSignature); // // Factory methods for verifying XML signatures @@ -591,114 +582,114 @@ public abstract class SPSSFactory { /** * Create a new <code>VerifyXMLSignatureRequest</code> object. - * - * @param dateTime The date for which the verification is to be performed. - * May be <code>null</code>. - * @param verifySignatureInfo Information about the signature environment and - * the location of the signature. - * @param supplementProfiles Supplemental information for the signature - * environment. May be <code>null</code>. + * + * @param dateTime The date for which the verification is to be + * performed. May be <code>null</code>. + * @param verifySignatureInfo Information about the signature environment + * and the location of the signature. + * @param supplementProfiles Supplemental information for the signature + * environment. May be <code>null</code>. * @param signatureManifestParams Additional information for checking the - * signature manifest. May be <code>null</code>. - * @param returnHashInputData If <code>true</code>, hash input data will - * be returned in the response, otherwise not. - * @param trustProfileID The ID of the trust profile containing the trusted - * root certificates. - * @return The new <code>VerifyXMLSignatureRequest</code> containing the - * above data. - * + * signature manifest. May be <code>null</code>. + * @param returnHashInputData If <code>true</code>, hash input data will be + * returned in the response, otherwise not. + * @param trustProfileID The ID of the trust profile containing the + * trusted root certificates. + * @return The new <code>VerifyXMLSignatureRequest</code> containing the above + * data. + * * @pre verifySignatureInfo != null - * @pre supplementProfiles != null implies - * forall Object o in supplementProfiles | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile + * @pre supplementProfiles != null implies forall Object o in supplementProfiles + * | o instanceof + * at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile * @pre trustProfileID != null && trustProfileID.length() > 0 * @post return != null */ public abstract VerifyXMLSignatureRequest createVerifyXMLSignatureRequest( - Date dateTime, - VerifySignatureInfo verifySignatureInfo, - List supplementProfiles, - SignatureManifestCheckParams signatureManifestParams, - boolean returnHashInputData, - String trustProfileID); - + Date dateTime, + VerifySignatureInfo verifySignatureInfo, + List supplementProfiles, + SignatureManifestCheckParams signatureManifestParams, + boolean returnHashInputData, + String trustProfileID); + /** * Create a new <code>VerifyXMLSignatureRequest</code> object. - * - * @param dateTime The date for which the verification is to be performed. - * May be <code>null</code>. - * @param verifySignatureInfo Information about the signature environment and - * the location of the signature. - * @param supplementProfiles Supplemental information for the signature - * environment. May be <code>null</code>. + * + * @param dateTime The date for which the verification is to be + * performed. May be <code>null</code>. + * @param verifySignatureInfo Information about the signature environment + * and the location of the signature. + * @param supplementProfiles Supplemental information for the signature + * environment. May be <code>null</code>. * @param signatureManifestParams Additional information for checking the - * signature manifest. May be <code>null</code>. - * @param returnHashInputData If <code>true</code>, hash input data will - * be returned in the response, otherwise not. - * @param trustProfileID The ID of the trust profile containing the trusted - * root certificates. - * @param extendedValidation Should the valdation result in forms - * @return The new <code>VerifyXMLSignatureRequest</code> containing the - * above data. - * + * signature manifest. May be <code>null</code>. + * @param returnHashInputData If <code>true</code>, hash input data will be + * returned in the response, otherwise not. + * @param trustProfileID The ID of the trust profile containing the + * trusted root certificates. + * @param extendedValidation Should the valdation result in forms + * @return The new <code>VerifyXMLSignatureRequest</code> containing the above + * data. + * * @pre verifySignatureInfo != null - * @pre supplementProfiles != null implies - * forall Object o in supplementProfiles | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile + * @pre supplementProfiles != null implies forall Object o in supplementProfiles + * | o instanceof + * at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile * @pre trustProfileID != null && trustProfileID.length() > 0 * @post return != null */ public abstract VerifyXMLSignatureRequest createVerifyXMLSignatureRequest( - Date dateTime, - VerifySignatureInfo verifySignatureInfo, - List supplementProfiles, - SignatureManifestCheckParams signatureManifestParams, - boolean returnHashInputData, - String trustProfileID, - boolean extendedValidation); + Date dateTime, + VerifySignatureInfo verifySignatureInfo, + List supplementProfiles, + SignatureManifestCheckParams signatureManifestParams, + boolean returnHashInputData, + String trustProfileID, + boolean extendedValidation); /** * Create a new <code>VerifySignatureInfo</code> object. - * - * @param verifySignatureEnvironment The signature environment containing - * the signature to be verified. - * @param verifySignatureLocation The location of the signature within the - * signature environment. + * + * @param verifySignatureEnvironment The signature environment containing the + * signature to be verified. + * @param verifySignatureLocation The location of the signature within the + * signature environment. * @return The new <code>VerifySignatureInfo</code> containing the above data. - * + * * @pre verifySignatureEnvironment != null * @pre verifySignatureLocation != null * @post return != null */ public abstract VerifySignatureInfo createVerifySignatureInfo( - Content verifySignatureEnvironment, - VerifySignatureLocation verifySignatureLocation); + Content verifySignatureEnvironment, + VerifySignatureLocation verifySignatureLocation); /** * Create a new <code>VerifySignatureLocation</code> object. - * - * @param xPathExpression The XPath expression to select the signature - * element within the signature environment. + * + * @param xPathExpression The XPath expression to select the signature + * element within the signature environment. * @param namespaceDeclarations The namespace prefix to URI mapping to apply - * while evaluating the XPath expression. + * while evaluating the XPath expression. * @return The new <code>VerifySignatureLocation</code> containing the above - * data. - * + * data. + * * @pre xPathExpression != null * @pre namespaceDeclarations != null * @post return != null */ public abstract VerifySignatureLocation createVerifySignatureLocation( - String xPathExpression, - Map namespaceDeclarations); + String xPathExpression, + Map namespaceDeclarations); /** - * Create a new <code>SupplementProfile</code> object containing a reference - * to a locally stored profile. - * + * Create a new <code>SupplementProfile</code> object containing a reference to + * a locally stored profile. + * * @param profileID The profile ID to resolve during signature verification. * @return The <code>SupplementProfile</code> containing the profile ID. - * + * * @pre profileID != null && profileID.length() > 0 * @post return != null */ @@ -707,7 +698,7 @@ public abstract class SPSSFactory { /** * Create a new <code>SupplementProfile</code> object by providing the profile * data explicitly. - * + * * @param supplementProfile The profile data. * @return The <code>SupplementProfile</code> containing the profile data. */ @@ -715,232 +706,227 @@ public abstract class SPSSFactory { /** * Create a new <code>SignatureManifestCheckParams</code> object. - * - * @param referenceInfos Information for checking the validity of a - * a reference. - * @param returnReferenceInputData If <code>true</code>, the input data to - * the calculation of reference digest values will be returned in the - * response, otherwise not. - * @return The <code>SignatureManifestCheckParams</code> containing the - * above data. - * + * + * @param referenceInfos Information for checking the validity of a a + * reference. + * @param returnReferenceInputData If <code>true</code>, the input data to the + * calculation of reference digest values will + * be returned in the response, otherwise not. + * @return The <code>SignatureManifestCheckParams</code> containing the above + * data. + * * @pre referenceInfos != null && referenceInfos.size() > 0 - * @pre forall Object o in referenceInfos | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo + * @pre forall Object o in referenceInfos | o instanceof + * at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo * @post return != null */ public abstract SignatureManifestCheckParams createSignatureManifestCheckParams( - List referenceInfos, - boolean returnReferenceInputData); + List referenceInfos, + boolean returnReferenceInputData); /** * Create a new <code>ReferenceInfo</code> object. - * - * @param verifyTransformsInfoProfiles The transformation profiles valid for - * the associated reference. - * @return The <code>ReferenceInfo</code> containing the transformation - * profiles. - * - * @pre verifyTransformsInfoProfiles != null && - * verifyTransformsInfoProfiles.size() > 0 - * @pre forall Object o in verifyTransformsInfoProfiles | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile + * + * @param verifyTransformsInfoProfiles The transformation profiles valid for the + * associated reference. + * @return The <code>ReferenceInfo</code> containing the transformation + * profiles. + * + * @pre verifyTransformsInfoProfiles != null && + * verifyTransformsInfoProfiles.size() > 0 + * @pre forall Object o in verifyTransformsInfoProfiles | o instanceof + * at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile * @post return != null */ public abstract ReferenceInfo createReferenceInfo(List verifyTransformsInfoProfiles); /** - * Create a new <code>VerifyTransformsInfoProfile</code> object containing - * a reference to a locally stored profile. - * + * Create a new <code>VerifyTransformsInfoProfile</code> object containing a + * reference to a locally stored profile. + * * @param profileID The profile ID to resolve during signature verification. - * @return The <code>VerifyTransformsInfoProfile</code> containing the - * given profile ID. - * + * @return The <code>VerifyTransformsInfoProfile</code> containing the given + * profile ID. + * * @pre profileID != null && profileID.length() > 0 * @post return != null */ public abstract VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(String profileID); /** - * Create a new <code>VerifyTransformsInfoProfile</code> object by providing - * the profile data explicitly. - * - * @param transforms A valid chain of transformations for the reference. - * May be <code>null</code>. + * Create a new <code>VerifyTransformsInfoProfile</code> object by providing the + * profile data explicitly. + * + * @param transforms A valid chain of transformations for the + * reference. May be <code>null</code>. * @param transformParameters Additional transformation information. * @return The <code>VerifyTransformsInfoProfile</code> containing the above - * data. - * - * @pre transforms != null implies - * (transforms.size() > 0 && - * forall Object o in transforms | o instanceof Transform) - * @pre transformParameters != null implies - * forall Object o in transformParameters | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter + * data. + * + * @pre transforms != null implies (transforms.size() > 0 && forall Object o in + * transforms | o instanceof Transform) + * @pre transformParameters != null implies forall Object o in + * transformParameters | o instanceof + * at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter * @post return != null */ public abstract VerifyTransformsInfoProfile createVerifyTransformsInfoProfile( - List transforms, - List transformParameters); + List transforms, + List transformParameters); /** - * Create a new <code>TransformParameter</code> object with the data - * contained at the given URI. - * + * Create a new <code>TransformParameter</code> object with the data contained + * at the given URI. + * * @param URI The URI identifying the data. The URI will be resolved during - * signature verification. - * @return The <code>TransformParameter</code> containing the URI of the - * data. - * + * signature verification. + * @return The <code>TransformParameter</code> containing the URI of the data. + * * @pre URI != null * @post return != null */ public abstract TransformParameter createTransformParameter(String URI); /** - * Creata a new <code>TransformParameter</code> object containing the - * binary data. - * - * @param URI The URI identifying the data. - * @param binaryData The binary data. + * Creata a new <code>TransformParameter</code> object containing the binary + * data. + * + * @param URI The URI identifying the data. + * @param binaryData The binary data. * @return The <code>TransformParameter</code> containig the binary data. - * + * * @pre URI != null * @pre binary != null * @post return != null */ public abstract TransformParameter createTransformParameter( - String URI, - InputStream binaryData); + String URI, + InputStream binaryData); /** - * Create a new <code>TransformParameter</code> object containing the hash - * value of the transformation data. - * - * @param URI The URI identifying the data. It will be resolved during - * signature verification. - * @param digestMethod The digest method used for calculating the digest - * value. - * @param digestValue The hash value of the transformation data. + * Create a new <code>TransformParameter</code> object containing the hash value + * of the transformation data. + * + * @param URI The URI identifying the data. It will be resolved during + * signature verification. + * @param digestMethod The digest method used for calculating the digest value. + * @param digestValue The hash value of the transformation data. * @return The <code>TransformParameter</code> containing the above data. - * + * * @pre URI != null * @pre digestMethod != null * @pre digestValue != null */ public abstract TransformParameter createTransformParameter( - String URI, - String digestMethod, - byte[] digestValue); + String URI, + String digestMethod, + byte[] digestValue); /** * Create a new <code>VerifyXMLSignatureResponse</code> object. - * - * @param signerInfo Information about the signer certificate. - * @param hashInputDatas The signed data objects. May be <code>null</code>. - * @param referenceInputDatas The reference input data objects. - * May be <code>null</code>. - * @param signatureCheck Status information about the signature check. - * @param signatureManifestCheck Status information about the signature - * manifest check. - * @param xmlDsigManifestChecks Status information about each XMLDsig manifest - * check. - * @param certificateCheck Status information about the signer certificate - * check. + * + * @param signerInfo Information about the signer certificate. + * @param hashInputDatas The signed data objects. May be + * <code>null</code>. + * @param referenceInputDatas The reference input data objects. May be + * <code>null</code>. + * @param signatureCheck Status information about the signature check. + * @param signatureManifestCheck Status information about the signature manifest + * check. + * @param xmlDsigManifestChecks Status information about each XMLDsig manifest + * check. + * @param certificateCheck Status information about the signer certificate + * check. * @return The <code>VerifyXMLSignatureResponse</code> containing the above - * data. - * + * data. + * * @pre signerInfo != null - * @pre hashInputDatas != null implies - * forall Object o in hashInputDatas | - * o instanceof at.gv.egovernment.moa.spss.api.common.Content - * @pre referenceInputDatas != null implies - * forall Object o in referenceInputDatas | - * o instanceof at.gv.egovernment.moa.spss.api.common.Content + * @pre hashInputDatas != null implies forall Object o in hashInputDatas | o + * instanceof at.gv.egovernment.moa.spss.api.common.Content + * @pre referenceInputDatas != null implies forall Object o in + * referenceInputDatas | o instanceof + * at.gv.egovernment.moa.spss.api.common.Content * @pre signatureCheck != null - * @pre xmlDsigManifestChecks != null implies - * forall Object o in xmlDsigManifestChecks | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverifyManifestRefsCheckResult + * @pre xmlDsigManifestChecks != null implies forall Object o in + * xmlDsigManifestChecks | o instanceof + * at.gv.egovernment.moa.spss.api.xmlverifyManifestRefsCheckResult * @pre certificateCheck != null * @post return != null */ public abstract VerifyXMLSignatureResponse createVerifyXMLSignatureResponse( - SignerInfo signerInfo, - List hashInputDatas, - List referenceInputDatas, - ReferencesCheckResult signatureCheck, - ReferencesCheckResult signatureManifestCheck, - List xmlDsigManifestChecks, - CheckResult certificateCheck, - List adesFormResults, - ExtendedCertificateCheckResult extCheckResult, - String signatureAlgorithm); + SignerInfo signerInfo, + List hashInputDatas, + List referenceInputDatas, + ReferencesCheckResult signatureCheck, + ReferencesCheckResult signatureManifestCheck, + List xmlDsigManifestChecks, + CheckResult certificateCheck, + List adesFormResults, + ExtendedCertificateCheckResult extCheckResult, + String signatureAlgorithm); /** * Create a new <code>ReferencesCheckResult</code> object. - * + * * @param code The status code. * @param info Additional information about the reference check. * @return The <code>ReferencesCheckResult</code> containing the above data. - * + * * @pre code >= 0 * @post return != null */ public abstract ReferencesCheckResult createReferencesCheckResult( - int code, - ReferencesCheckResultInfo info); + int code, + ReferencesCheckResultInfo info); /** * Create a new <code>ReferencesCheckResultInfo</code> object. - * - * @param anyOtherInfo Arbitrary XML content describing the check result. - * May be <code>null</code>. - * @param failedReferences The indexes of the failed references. May be - * <code>null</code>. - * @return The <code>ReferencesCheckResultInfo</code> containing the above - * data. - * + * + * @param anyOtherInfo Arbitrary XML content describing the check result. + * May be <code>null</code>. + * @param failedReferences The indexes of the failed references. May be + * <code>null</code>. + * @return The <code>ReferencesCheckResultInfo</code> containing the above data. + * * @post return != null */ public abstract ReferencesCheckResultInfo createReferencesCheckResultInfo( - NodeList anyOtherInfo, - int[] failedReferences); + NodeList anyOtherInfo, + int[] failedReferences); /** * Create a new <code>ManifestRefsCheckResult</code> object. - * + * * @param code The status code. * @param info Additional information about the manifest check. May be - * <code>null</code>. - * @return The <code>ManifestRefsCheckResult</code> containing the above - * data. - * + * <code>null</code>. + * @return The <code>ManifestRefsCheckResult</code> containing the above data. + * * @pre code >= 0 * @post return != null */ public abstract ManifestRefsCheckResult createManifestRefsCheckResult( - int code, - ManifestRefsCheckResultInfo info); + int code, + ManifestRefsCheckResultInfo info); /** * Create a new <code>ManifestRefsCheckResultInfo</code> object. - * - * @param anyOtherInfo Arbitrary XML content describing the check result. - * May be <code>null</code>. - * @param failedReferences The indexes of the failed references. May be - * <code>null</code>. + * + * @param anyOtherInfo Arbitrary XML content describing the check + * result. May be <code>null</code>. + * @param failedReferences The indexes of the failed references. May be + * <code>null</code>. * @param referringSigReference The index of the reference in the signature. - * @return The <code>ManifestRefsCheckResultInfo</code> containing the - * above data. - * + * @return The <code>ManifestRefsCheckResultInfo</code> containing the above + * data. + * * @pre referringSigReference > 0 * @post return != null */ public abstract ManifestRefsCheckResultInfo createManifestRefsCheckResultInfo( - NodeList anyOtherInfo, - int[] failedReferences, - int referringSigReference); + NodeList anyOtherInfo, + int[] failedReferences, + int referringSigReference); // // Factory methods for common objects @@ -948,10 +934,10 @@ public abstract class SPSSFactory { /** * Create a new <code>Content</code> object referencing data via a URI. - * + * * @param referenceURI The URI pointing to the content. * @return The <code>Content</code> object containing the reference. - * + * * @pre referenceURI != null && referenceURI.length() > 0 * @post return != null */ @@ -959,41 +945,43 @@ public abstract class SPSSFactory { /** * Create a new <code>Content</code> object containing binary data. - * - * @param binaryData An <code>InputStream</code> containing the binary data. + * + * @param binaryData An <code>InputStream</code> containing the binary data. * @param referenceURI An URI identifying the data. May be <code>null</code>. * @return The <code>Content</code> object containing the data. - * + * * @pre binaryData != null * @post return != null */ public abstract Content createContent( - InputStream binaryData, - String referenceURI); + InputStream binaryData, + String referenceURI); /** - * Create a new <code>Content</code> object containing location reference data. - * - * @param locationReferenceURI a URI pointing to the actual remote location of the content. - * - * @param referenceURI An URI identifying the data. May be <code>null</code>. - * - * @return The <code>Content</code> object containing the data. - * - * @pre locationReferenceURI != null - * @post return != null - */ - public abstract Content createContent( - String locationReferenceURI, - String referenceURI); + * Create a new <code>Content</code> object containing location reference data. + * + * @param locationReferenceURI a URI pointing to the actual remote location of + * the content. + * + * @param referenceURI An URI identifying the data. May be + * <code>null</code>. + * + * @return The <code>Content</code> object containing the data. + * + * @pre locationReferenceURI != null + * @post return != null + */ + public abstract Content createContent( + String locationReferenceURI, + String referenceURI); /** * Create a new <code>Content</code> object containing XML data. - * - * @param xmlData The XML data contained in the new <code>Content</code>. + * + * @param xmlData The XML data contained in the new <code>Content</code>. * @param referenceURI An URI identifying the data. May be <code>null</code>. * @return The <code>Content</code> object containing the data. - * + * * @pre xmlData != null * @post return != null */ @@ -1001,13 +989,11 @@ public abstract class SPSSFactory { /** * Create a new <code>XMLDataObjectAssociation</code> object. - * - * @param metaInfo Information about the content type. May be - * <code>null</code>. - * @param content The <code>Content</code> object containing the data. - * @return The <code>XMLDataObjectAssociation</code> containing the above - * data. - * + * + * @param metaInfo Information about the content type. May be <code>null</code>. + * @param content The <code>Content</code> object containing the data. + * @return The <code>XMLDataObjectAssociation</code> containing the above data. + * * @pre content != null * @pre content.getContentType() == Content.CONTENT_XML || * content.getContentType() == Contetn.CONTENT_BINARY @@ -1015,34 +1001,36 @@ public abstract class SPSSFactory { * @post return != null */ public abstract XMLDataObjectAssociation createXMLDataObjectAssociation( - MetaInfo metaInfo, - Content content); + MetaInfo metaInfo, + Content content); /** * Create a new <code>MetaInfo</code> object. - * - * @param mimeType The MIME type part of the meta information. + * + * @param mimeType The MIME type part of the meta information. * @param description Descriptive meta information. May be <code>null</code>. - * @param otherInfo XML meta information. May be <code>null</code>. - * @param type Type information for XML signature creation. May be <code>null</code>. + * @param otherInfo XML meta information. May be <code>null</code>. + * @param type Type information for XML signature creation. May be + * <code>null</code>. * @return The <code>MetaInfo</code> object containing the above data. - * + * * @pre mimeType != null && mimeType.length() > 0 - * @pre otherInfo != null implies - * forall Node n in otherInfo | n.getNodeType() == Node.ELEMENT + * @pre otherInfo != null implies forall Node n in otherInfo | n.getNodeType() + * == Node.ELEMENT */ public abstract MetaInfo createMetaInfo( - String mimeType, - String description, - NodeList otherInfo, - String type); + String mimeType, + String description, + NodeList otherInfo, + String type); /** - * Create a <code>CanonicalizationTransform</code> type of <code>Transform</code>. - * + * Create a <code>CanonicalizationTransform</code> type of + * <code>Transform</code>. + * * @param algorithmURI The algorithm URI of the canonicalization. * @return The created <code>CanonicalizationTransform</code> object. - * + * * @pre CanonicalizationTransform.CANONICAL_XML.equals(algorithmURI) || * CanonicalizationTransform.CANONICAL_XML_WITH_COMMENTS.equals(algorithmURI) * @post return != null @@ -1052,95 +1040,95 @@ public abstract class SPSSFactory { /** * Create an <code>ExclusiveCanonicalizationTransform</code> type of * <code>Transform</code>. - * - * @param algorithmURI The algorithm URI of the exclusive canonicalization. - * @param inclusiveNamespacePrefixes The prefixes of the namespaces to - * treat according to canonical XML. + * + * @param algorithmURI The algorithm URI of the exclusive + * canonicalization. + * @param inclusiveNamespacePrefixes The prefixes of the namespaces to treat + * according to canonical XML. * @return The new <code>ExclusiveCanonicalizationTransform</code> - * - * @pre ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML.equals(algorithmURI) || + * + * @pre ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML.equals(algorithmURI) + * || * ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS.equals(algorithmURI) * @pre inclusiveNamespacePrefixes != null - * @pre forall Object o in inclusiveNamespacePrefixes | o instanceof String + * @pre forall Object o in inclusiveNamespacePrefixes | o instanceof String * @post return != null */ public abstract Transform createExclusiveCanonicalizationTransform( - String algorithmURI, - List inclusiveNamespacePrefixes); + String algorithmURI, + List inclusiveNamespacePrefixes); /** * Create a <code>Base64Transform</code> type of <code>Transform</code>. - * + * * @return A <code>Transform</code> denoting a Base64 decoding. - * + * * @post return != null */ public abstract Transform createBase64Transform(); /** - * Create a <code>EnvelopedSignatureTransform</code> type of + * Create a <code>EnvelopedSignatureTransform</code> type of * <code>Transform</code>. - * + * * @return A <code>Transform</code> denoting an enveloped signature. - * + * * @post return != null */ public abstract Transform createEnvelopedSignatureTransform(); /** * Create an <code>XSLTTransform</code> type of <code>Transform</code>. - * - * @param styleSheet The XSLT stylesheet contained in the - * <code>Transform</code>. + * + * @param styleSheet The XSLT stylesheet contained in the + * <code>Transform</code>. * @return A <code>Transform</code> containing the XSLT stylesheet. - * + * * @post return != null */ public abstract Transform createXSLTTransform(Element styleSheet); /** * Create an <code>XPathTransform</code> type of <code>Transform</code>. - * - * @param xPathExpression The XPath expression to use in the created - * <code>Transform</code>. - * @param namespaceDeclarations The namespace prefix to URI mapping to - * apply on evaluation of the XPath expression. + * + * @param xPathExpression The XPath expression to use in the created + * <code>Transform</code>. + * @param namespaceDeclarations The namespace prefix to URI mapping to apply on + * evaluation of the XPath expression. * @return The <code>XPathTransform</code> containing the above data. - * + * * @pre xPathExpression != null * @pre namespaceDeclarations != null * @post return != null */ public abstract Transform createXPathTransform( - String xPathExpression, - Map namespaceDeclarations); + String xPathExpression, + Map namespaceDeclarations); /** - * Create a new <code>XPathFilter2Transform</code> type of - * <code>Transform</code>. - * + * Create a new <code>XPathFilter2Transform</code> type of + * <code>Transform</code>. + * * @param xPathFilters The filters contained in the newly created - * <code>XPathFilter2Transform</code>. - * @return The <code>XPathFilter2Transform</code> containing the given - * filters. - * - * @pre xPathFilters != null && - * forall Object o in xPathFilters | - * o instanceof at.gv.egovernment.moa.spss.api.common.XPathFilter + * <code>XPathFilter2Transform</code>. + * @return The <code>XPathFilter2Transform</code> containing the given filters. + * + * @pre xPathFilters != null && forall Object o in xPathFilters | o instanceof + * at.gv.egovernment.moa.spss.api.common.XPathFilter * @post return != null */ public abstract Transform createXPathFilter2Transform(List xPathFilters); /** * Create a new <code>XPathFilter</code> object. - * - * @param filterType The type of filter. - * @param xPathExpression The XPath expression contained in this filter. - * @param namespaceDeclarations The namespace prefix to URI mapping to apply - * on evaluation of the XPath expression. + * + * @param filterType The type of filter. + * @param xPathExpression The XPath expression contained in this filter. + * @param namespaceDeclarations The namespace prefix to URI mapping to apply on + * evaluation of the XPath expression. * @return The <code>XPathFilter</code> containing the above data. - * - * @pre XPathFilter.SUBTRACT_TYPE.equals(filterType) || + * + * @pre XPathFilter.SUBTRACT_TYPE.equals(filterType) || * XPathFilter.INTERSECT_TYPE.equals(filterType) || * XPathFilter.UNION_TYPE.equals(filterType) * @pre xPathExpression != null @@ -1148,73 +1136,76 @@ public abstract class SPSSFactory { * @post return != null */ public abstract XPathFilter createXPathFilter( - String filterType, - String xPathExpression, - Map namespaceDeclarations); + String filterType, + String xPathExpression, + Map namespaceDeclarations); /** * Create a new <code>CheckResult</code> object. - * + * * @param code The check code. * @param info Verbose information about the check. May be <code>null</code>. * @return The <code>CheckResult</code> containing the above data. - * + * * @pre code >= 0 * @post return != null */ public abstract CheckResult createCheckResult(int code, NodeList info); - - /** * Create a new <code>SignerInfo</code> object. - * - * @param signerCertificate The signer certificate in binary form. - * @param qualifiedCertificate <code>true</code>, if the signer certificate is - * a qualified certificate, otherwise <code>false</code>. - * @param qcSourceTSL <code>true</code>, if the QC information comes from the TSL, - * otherwise <code>false</code>. - * @param publicAuthority <code>true</code>, if the signer certificate is a - * public authority certificate, otherwise <code>false</code>. - * @param publicAuthorityID The identification of the public authority - * (if <code>publicAuthority</code> is <code>true</code>). May be - * <code>null</code>. - * @param sscd <code>true</code>, if the TSL check verifies the - * signature based on a SSDC, otherwise <code>false</code>. - * @param sscdSourceTSL <code>true</code>, if the SSCD information comes from the TSL, - * otherwise <code>false</code>. - * @param issuerCountryCode contains the signer certificate issuer country code. - * @param tslInfos contains information from Trust-Status List for the signer certificate + * + * @param signerCertificate The signer certificate in binary form. + * @param qualifiedCertificate <code>true</code>, if the signer certificate is a + * qualified certificate, otherwise + * <code>false</code>. + * @param qcSourceTSL <code>true</code>, if the QC information comes + * from the TSL, otherwise <code>false</code>. + * @param publicAuthority <code>true</code>, if the signer certificate is a + * public authority certificate, otherwise + * <code>false</code>. + * @param publicAuthorityID The identification of the public authority (if + * <code>publicAuthority</code> is + * <code>true</code>). May be <code>null</code>. + * @param sscd <code>true</code>, if the TSL check verifies the + * signature based on a SSDC, otherwise + * <code>false</code>. + * @param sscdSourceTSL <code>true</code>, if the SSCD information comes + * from the TSL, otherwise <code>false</code>. + * @param issuerCountryCode contains the signer certificate issuer country + * code. + * @param tslInfos contains information from Trust-Status List for + * the signer certificate * @return The <code>SignerInfo</code> containing the above data. - * + * * @pre signerCertSubjectName != null * @pre signerCertIssuerSerial != null * @pre signerCertificate != null */ public abstract SignerInfo createSignerInfo( - X509Certificate signerCertificate, - boolean qualifiedCertificate, - boolean qcSourceTSL, - boolean publicAuthority, - String publicAuthorityID, - boolean sscd, - boolean sscdSourceTSL, - String issuerCountryCode, - Date signingTime, - TslInfos tslInfos); - + X509Certificate signerCertificate, + boolean qualifiedCertificate, + boolean qcSourceTSL, + boolean publicAuthority, + String publicAuthorityID, + boolean sscd, + boolean sscdSourceTSL, + String issuerCountryCode, + Date signingTime, + TslInfos tslInfos); + /** * Create a new <code>X509IssuerSerial</code> object. - * - * @param issuerName The distinguished name of the issuer. + * + * @param issuerName The distinguished name of the issuer. * @param issuerSerial The certificate serial number. * @return The <code>X509IssuerSerial</code> containing the above data. - * + * * @pre issuerName != null * @pre issuerSerial != null */ public abstract X509IssuerSerial createX509IssuerSerial( - String issuerName, - BigInteger issuerSerial); + String issuerName, + BigInteger issuerSerial); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureCreationService.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureCreationService.java index 05271fb..4019ad7 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureCreationService.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureCreationService.java @@ -21,18 +21,16 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api; import at.gv.egovernment.moa.spss.MOAException; - import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; import at.gv.egovernment.moa.spss.server.invoke.SignatureCreationServiceImpl; /** * Interface providing functions for signature creation. - * + * * @author Patrick Peck * @version $Id$ */ @@ -40,42 +38,40 @@ public abstract class SignatureCreationService { /** The default implementation class. */ private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.server.invoke.SignatureCreationServiceImpl"; - - /** The single instance of this class. */ + "at.gv.egovernment.moa.spss.server.invoke.SignatureCreationServiceImpl"; + + /** The single instance of this class. */ private static SignatureCreationService instance = null; /** * Get an instance of the <code>SignatureCreationService</code>. - * + * * @return A concrete instance of the <code>SignatureCreationService</code>. */ public static synchronized SignatureCreationService getInstance() { if (instance == null) { try { - /* - DiscoverClass discover = new DiscoverClass(); - instance = - (SignatureCreationService) discover.newInstance( - SignatureCreationService.class, - DEFAULT_IMPLEMENTATION);*/ + /* + * DiscoverClass discover = new DiscoverClass(); instance = + * (SignatureCreationService) discover.newInstance( + * SignatureCreationService.class, DEFAULT_IMPLEMENTATION); + */ instance = new SignatureCreationServiceImpl(); - } catch (Exception e) { - // this can not happen since we provide a valid default + } catch (final Exception e) { + // this can not happen since we provide a valid default // implementation } } return instance; } - + /** * Create an XML signature. - * + * * @param request Information on how to create the signature. - * @return A <code>CreateXMLSignatureResponse</code> containing the - * signature. + * @return A <code>CreateXMLSignatureResponse</code> containing the signature. * @throws MOAException Error in server side MOA module. */ public abstract CreateXMLSignatureResponse createXMLSignature(CreateXMLSignatureRequest request) - throws MOAException; + throws MOAException; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java index 2433e20..7d95d3a 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api; import at.gv.egovernment.moa.spss.MOAException; @@ -33,7 +32,7 @@ import at.gv.egovernment.moa.spss.server.invoke.SignatureVerificationServiceImpl /** * Interface providing functions for verifying signatures. - * + * * @author Patrick Peck * @version $Id$ */ @@ -41,28 +40,27 @@ public abstract class SignatureVerificationService { /** The default implementation class. */ private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.server.invoke.SignatureVerificationServiceImpl"; + "at.gv.egovernment.moa.spss.server.invoke.SignatureVerificationServiceImpl"; /** The single instance of this class. */ private static SignatureVerificationService instance = null; /** * Get an instance of the <code>SignatureVerificationService</code>. - * - * @return A concrete instance of the - * <code>SignatureVerificationService</code>. + * + * @return A concrete instance of the <code>SignatureVerificationService</code>. */ public static synchronized SignatureVerificationService getInstance() { if (instance == null) { try { - /*DiscoverClass discover = new DiscoverClass(); - instance = - (SignatureVerificationService) discover.newInstance( - SignatureVerificationService.class, - DEFAULT_IMPLEMENTATION);*/ - instance = new SignatureVerificationServiceImpl(); - } catch (Exception e) { - // this can not happen since we provide a valid default + /* + * DiscoverClass discover = new DiscoverClass(); instance = + * (SignatureVerificationService) discover.newInstance( + * SignatureVerificationService.class, DEFAULT_IMPLEMENTATION); + */ + instance = new SignatureVerificationServiceImpl(); + } catch (final Exception e) { + // this can not happen since we provide a valid default // implementation } } @@ -71,23 +69,24 @@ public abstract class SignatureVerificationService { /** * Verify a CMS signature. - * + * * @param request Detailed information on the verification that should be - * performed. + * performed. * @return A <code>VerifyCMSSignatureResponse</code> object that contains - * information about the performed verification. + * information about the performed verification. * @throws MOAException Error in server side MOA module. */ public abstract VerifyCMSSignatureResponse verifyCMSSignature(VerifyCMSSignatureRequest request) - throws MOAException; + throws MOAException; + /** * Verfiy an XML Signature. - * - * @param request information on the verification that should be performed. + * + * @param request information on the verification that should be performed. * @return A <code>VerifyXMLSignatureResponse</code> object that contains - * information about the performed verification. + * information about the performed verification. * @throws MOAException Error in server side MOA module. */ public abstract VerifyXMLSignatureResponse verifyXMLSignature(VerifyXMLSignatureRequest request) - throws MOAException; + throws MOAException; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CMSSignatureResponse.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CMSSignatureResponse.java index 10db676..958bd7d 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CMSSignatureResponse.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CMSSignatureResponse.java @@ -21,21 +21,19 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmssign; - /** * Contains the signature if the signature creation was successful. - * + * * @version $Id$ */ public interface CMSSignatureResponse - extends CreateCMSSignatureResponseElement { - /** + extends CreateCMSSignatureResponseElement { + /** * Gets the CMS signature (Base64 encoded). - * + * * @return The CMS signature */ - public String getCMSSignature(); + String getCMSSignature(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureRequest.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureRequest.java index 9d5cd7a..c971451 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureRequest.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureRequest.java @@ -21,29 +21,28 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmssign; import java.util.List; - /** * Object that encapsulates a request to create a CMS Signature. - * - * + * + * * @version $Id$ */ public interface CreateCMSSignatureRequest { /** * Gets the identifier for the keys to be used for the signature. - * + * * @return The identifier for the keys to be used. */ - public String getKeyIdentifier(); + String getKeyIdentifier(); + /** - * Gets the information of the singleSignatureInfo elements. - * + * Gets the information of the singleSignatureInfo elements. + * * @return The information of singleSignatureInfo elements. */ - public List getSingleSignatureInfos(); + List getSingleSignatureInfos(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureResponse.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureResponse.java index 6062a11..e81a2bc 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureResponse.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureResponse.java @@ -21,22 +21,21 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmssign; import java.util.List; /** - * Object that encapsulates the response on to a + * Object that encapsulates the response on to a * <code>CreateCMSSignatureRequest</code> to create an XML signature. - * + * * @version $Id$ */ public interface CreateCMSSignatureResponse { /** * Gets the response elements. - * + * * @return The response elements. */ - public List getResponseElements(); + List getResponseElements(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureResponseElement.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureResponseElement.java index 8e4e611..a8d0ebd 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureResponseElement.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/CreateCMSSignatureResponseElement.java @@ -21,31 +21,29 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmssign; /** - * Base class for <code>CMSSignature</code> and - * <code>ErrorResponse</code> elements in a - * <code>CreateXMLSignatureResponse</code>. - * + * Base class for <code>CMSSignature</code> and <code>ErrorResponse</code> + * elements in a <code>CreateXMLSignatureResponse</code>. + * * @version $Id$ */ public interface CreateCMSSignatureResponseElement { /** * Indicates that this object contains a <code>CMSSignature</code>. */ - public static final int CMS_SIGNATURE = 0; + int CMS_SIGNATURE = 0; /** * Indicates that this objet contains an <code>ErrorResponse</code>. */ - public static final int ERROR_RESPONSE = 1; - + int ERROR_RESPONSE = 1; + /** * Gets the type of response object. - * - * @return The type of response object, either - * <code>CMS_SIGNATURE</code> or <code>ERROR_RESPONSE</code>. + * + * @return The type of response object, either <code>CMS_SIGNATURE</code> or + * <code>ERROR_RESPONSE</code>. */ - public int getResponseType(); + int getResponseType(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/DataObjectInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/DataObjectInfo.java index b9f3630..4f97e5a 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/DataObjectInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/DataObjectInfo.java @@ -21,38 +21,37 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmssign; import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; /** * Encapsulates information required to create a single signature. - * + * * @version $Id$ */ public interface DataObjectInfo { /** * Indicates that a detached signature will be created. */ - public static final String STRUCTURE_DETACHED = "detached"; + String STRUCTURE_DETACHED = "detached"; /** * Indicates that an enveloping signature will be created. */ - public static final String STRUCTURE_ENVELOPING = "enveloping"; + String STRUCTURE_ENVELOPING = "enveloping"; /** * Gets the structure of the signature. - * + * * @return The structure of the signature. */ - public String getStructure(); + String getStructure(); /** * Gets information related to a single data object. - * + * * @return Information related to a single data object. */ - public CMSDataObject getDataObject(); - + CMSDataObject getDataObject(); + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/SingleSignatureInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/SingleSignatureInfo.java index 4d56cf3..2bff558 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/SingleSignatureInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmssign/SingleSignatureInfo.java @@ -21,14 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmssign; - - /** * Encapsulates data to create a single signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,24 +33,24 @@ package at.gv.egovernment.moa.spss.api.cmssign; public interface SingleSignatureInfo { /** * Gets the dataObjectInfo information. - * + * * @return The dataObjectInfo information. */ - public DataObjectInfo getDataObjectInfo(); - + DataObjectInfo getDataObjectInfo(); + /** * Check whether a Security Layer conform signature manifest will be created. - * - * @return <code>true</code>, if a Security Layer conform signature manifest - * will be created, <code>false</code> otherwise. + * + * @return <code>true</code>, if a Security Layer conform signature manifest + * will be created, <code>false</code> otherwise. */ - public boolean isSecurityLayerConform(); - + boolean isSecurityLayerConform(); + /** - * Check whether a PAdES conform CAdES signature will be created - * - * @return <code>true</code>, if a PAdES conform CAdES signature - * will be created, <code>false</code> otherwise. + * Check whether a PAdES conform CAdES signature will be created + * + * @return <code>true</code>, if a PAdES conform CAdES signature will be + * created, <code>false</code> otherwise. */ - public boolean isPAdESConform(); + boolean isPAdESConform(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java index 4c2c1cc..f240da8 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmsverify; /** * Base class for objects containing CMS content. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -35,18 +34,18 @@ public interface CMSContent { /** * Indicates that this object contains a reference to the CMS content. */ - public static final int REFERENCE_CONTENT = 0; + int REFERENCE_CONTENT = 0; /** * Indicates that this object contains the CMS content explicitly. */ - public static final int EXPLICIT_CONTENT = 1; - + int EXPLICIT_CONTENT = 1; + /** * Gets the type of the contained content. - * + * * @return The type of content, either <code>REFERENCE_CONTENT</code> or - * <code>EXPLICIT_CONTENT</code>. + * <code>EXPLICIT_CONTENT</code>. */ - public int getContentType(); - + int getContentType(); + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java index 7fc6029..1c6506c 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmsverify; import java.io.InputStream; /** * Encapsulates binary CMS content. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,8 +35,8 @@ import java.io.InputStream; public interface CMSContentExcplicit extends CMSContent { /** * Gets the content as a stream. - * + * * @return A stream containing the binary content. */ - public InputStream getBinaryContent(); + InputStream getBinaryContent(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java index ade197d..c7366ff 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmsverify; /** * Encapsulates CMS content that is referenced by an URI. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -34,8 +33,8 @@ package at.gv.egovernment.moa.spss.api.cmsverify; public interface CMSContentReference extends CMSContent { /** * Gets the reference URI from wher the content can be retrieved. - * + * * @return The reference URI. */ - public String getReference(); + String getReference(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java index f9a6846..ffd31e1 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmsverify; import java.math.BigDecimal; @@ -30,7 +29,7 @@ import at.gv.egovernment.moa.spss.api.common.MetaInfo; /** * A data object used for verification of CMS signatures. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -38,20 +37,20 @@ import at.gv.egovernment.moa.spss.api.common.MetaInfo; public interface CMSDataObject { /** * Gets the meta information of the content. - * + * * @return An object containig the meta information. */ - public MetaInfo getMetaInfo(); + MetaInfo getMetaInfo(); + /** * Gets the actual content of the data object. - * + * * @return The actual content. */ - public CMSContent getContent(); - - - public BigDecimal getExcludeByteRangeFrom(); - - public BigDecimal getExcludeByteRangeTo(); - - } + CMSContent getContent(); + + BigDecimal getExcludeByteRangeFrom(); + + BigDecimal getExcludeByteRangeTo(); + +} diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java index 6294fb1..5ce51cf 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmsverify; import java.io.InputStream; @@ -29,7 +28,7 @@ import java.util.Date; /** * Object that encapsulates a request to verify a CMS signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -38,42 +37,48 @@ public interface VerifyCMSSignatureRequest { /** * Indicates, that signature checks for all signatories must be returned. */ - public static int[] ALL_SIGNATORIES = new int[] { -1 }; + int[] ALL_SIGNATORIES = new int[] { -1 }; + /** * Gets the positions of signatories whose signature must be verified. - * + * * @return The positions of signatories. */ - public int[] getSignatories(); + int[] getSignatories(); + /** - * Gets the date and time for which the signature verification has to - * be performed. - * - * @return Date and time for which the signature verification has - * to be performed. + * Gets the date and time for which the signature verification has to be + * performed. + * + * @return Date and time for which the signature verification has to be + * performed. */ - public Date getDateTime(); + Date getDateTime(); + /** * Gets the binary CMS signature. - * - * @return An <code>InputStream</code> from which the binary CMS signature - * can be read. + * + * @return An <code>InputStream</code> from which the binary CMS signature can + * be read. */ - public InputStream getCMSSignature(); - /** + InputStream getCMSSignature(); + + /** * Gets the data object necessary for the verification. - * + * * @return The data object necessary for verification. */ - public CMSDataObject getDataObject(); + CMSDataObject getDataObject(); + /** * Gets the profile ID of trusted certificates to be used for signature * verification. - * + * * @return The profile ID of trusted certificates. */ - public String getTrustProfileId(); - - public boolean isPDF(); - public boolean isExtended(); + String getTrustProfileId(); + + boolean isPDF(); + + boolean isExtended(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java index 33924cb..9f58c43 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java @@ -21,16 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmsverify; import java.util.List; - /** - * Object that encapsulates the response on a request to verify a CMS - * signature. - * + * Object that encapsulates the response on a request to verify a CMS signature. + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -38,8 +35,8 @@ import java.util.List; public interface VerifyCMSSignatureResponse { /** * Gets the response elements. - * - * @return The response elements. + * + * @return The response elements. */ - public List getResponseElements(); + List getResponseElements(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java index ec540bf..35bdf6e 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.cmsverify; import java.util.List; @@ -32,7 +31,7 @@ import at.gv.egovernment.moa.spss.api.common.SignerInfo; /** * Contains detailed information about the verification of a signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -40,37 +39,39 @@ import at.gv.egovernment.moa.spss.api.common.SignerInfo; public interface VerifyCMSSignatureResponseElement { /** * Gets a SignerInfo element according to CMS. - * + * * @return The SignerInfo element according to CMS. */ - public SignerInfo getSignerInfo(); + SignerInfo getSignerInfo(); + /** * Gets the result of the signature verification. - * + * * @return The result of the signature verification. */ - public CheckResult getSignatureCheck(); + CheckResult getSignatureCheck(); + /** * Gets the result of the certificate verification. - * + * * @return The result of the certificate verification. */ - public CheckResult getCertificateCheck(); - + CheckResult getCertificateCheck(); + /** * Gets AdES Form results - * + * * This might be null! - * + * * @return The result of the AdES Form validation */ - public List getAdESFormResults(); - - public ExtendedCertificateCheckResult getExtendedCertificateCheck(); - - public String getSignatureAlgorithm(); - - public Boolean getCoversFullDocument(); - - public int[] getByteRangeOfSignature(); + List getAdESFormResults(); + + ExtendedCertificateCheckResult getExtendedCertificateCheck(); + + String getSignatureAlgorithm(); + + Boolean getCoversFullDocument(); + + int[] getByteRangeOfSignature(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Base64Transform.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Base64Transform.java index 6050d5b..e1c650f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Base64Transform.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Base64Transform.java @@ -21,17 +21,16 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; /** * A <code>Transform</code> performing a Base64 decoding. - * + * * @author Patrick Peck * @version $Id$ */ public interface Base64Transform extends Transform { /** Algorithm URI of the Base64 <code>Transform</code> type. */ - public static final String BASE64_DECODING = - "http://www.w3.org/2000/09/xmldsig#base64"; + String BASE64_DECODING = + "http://www.w3.org/2000/09/xmldsig#base64"; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java index 05977c5..680061d 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java @@ -21,21 +21,20 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import at.gv.egovernment.moaspss.util.Constants; /** * A canonicalization type of <code>Transform</code>. - * + * * @author Patrick Peck * @version $Id$ */ public interface CanonicalizationTransform extends Transform { /** Algorithm URI of canonical XML. */ - public static final String CANONICAL_XML = Constants.C14N_URI; + String CANONICAL_XML = Constants.C14N_URI; /** Algorithm URI of canonical XML with comments. */ - public static final String CANONICAL_XML_WITH_COMMENTS = - Constants.C14N_WITH_COMMENTS_URI; + String CANONICAL_XML_WITH_COMMENTS = + Constants.C14N_WITH_COMMENTS_URI; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/CheckResult.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/CheckResult.java index 5c94981..4a9ff27 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/CheckResult.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/CheckResult.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import org.w3c.dom.NodeList; /** * Object encapsulating the result of a signature verification. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,14 +35,15 @@ import org.w3c.dom.NodeList; public interface CheckResult { /** * Gets the result code. - * + * * @return The result code. */ - public int getCode(); + int getCode(); + /** * Gets descriptive information. - * + * * @return Descriptive information. */ - public NodeList getInfo(); + NodeList getInfo(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Content.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Content.java index efde1eb..d9adb68 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Content.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Content.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; /** * Encapsulates content data. - * + * * @author Patrick Peck * @author Stephan Grill * @author Gregor Karlinger @@ -35,37 +34,38 @@ package at.gv.egovernment.moa.spss.api.common; public interface Content { /** - * Indicates that this object contains a URI reference to some content. + * Indicates that this object contains a URI reference to some content. */ - public static final int REFERENCE_CONTENT = 0; + int REFERENCE_CONTENT = 0; /** * Indicates that this object contains binary content. */ - public static final int BINARY_CONTENT = 1; + int BINARY_CONTENT = 1; /** * Indicates that this object contains XML content. */ - public static final int XML_CONTENT = 2; - + int XML_CONTENT = 2; + /** * Indicates that this object contains a location reference content. */ - public static final int LOCREF_CONTENT = 3; + int LOCREF_CONTENT = 3; /** * Gets the type of content contained in this object. - * - * @return The type of content, one of <code>BINARY_CONTENT</code>, <code>XML_CONTENT</code>, <code> + * + * @return The type of content, one of <code>BINARY_CONTENT</code>, + * <code>XML_CONTENT</code>, <code> * REFERENCE_CONTENT</code> or <code>LOCREF_CONTENT</code>. */ - public int getContentType(); + int getContentType(); /** * Gets the reference to the content data (a URI). - * + * * @return The reference to the content data. */ - public String getReference(); + String getReference(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentBinary.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentBinary.java index 77ec9dd..a30c5f8 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentBinary.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentBinary.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import java.io.InputStream; /** * Encapsulates binary content. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,10 +35,10 @@ import java.io.InputStream; public interface ContentBinary extends Content { /** * Get the binary content. - * - * @return An <code>InputStream</code> from which the binary content can - * be read. + * + * @return An <code>InputStream</code> from which the binary content can be + * read. */ - public InputStream getBinaryContent(); - + InputStream getBinaryContent(); + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java index d1ef096..59c96cb 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java @@ -21,21 +21,20 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; /** * Encapsulates location reference content. - * + * * @author Gregor Karlinger * @version $Id$ */ -public interface ContentLocRef extends Content -{ +public interface ContentLocRef extends Content { /** - * Gets the location reference URI pointing to the actual remote location of the content. - * + * Gets the location reference URI pointing to the actual remote location of the + * content. + * * @return the location reference URI. */ - public String getLocationReferenceURI(); + String getLocationReferenceURI(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentReference.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentReference.java index 8c4a658..5650939 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentReference.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentReference.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; /** * Content containing a reference to content data. - * + * * @author Patrick Peck * @version $Id$ */ diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentXML.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentXML.java index d41f6a6..1f294b1 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentXML.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentXML.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import org.w3c.dom.NodeList; /** * Encapsulates arbitrary XML content. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,8 +35,8 @@ import org.w3c.dom.NodeList; public interface ContentXML extends Content { /** * Gets the XML content stored in this object. - * + * * @return The XML content. */ - public NodeList getXMLContent(); + NodeList getXMLContent(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ElementSelector.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ElementSelector.java index b446c5f..9d29d9b 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ElementSelector.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ElementSelector.java @@ -21,32 +21,32 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import java.util.Map; /** - * A class containing data for selecting single elements using an XPath + * A class containing data for selecting single elements using an XPath * expression. - * + * * Derived classes are used to point to the <code>CreateSignatureLocation</code> * and the <code>VerifySignatureLocation</code>. - * + * * @author Patrick Peck * @version $Id$ */ public interface ElementSelector { /** * Gets the XPath expression pointing to a single element. - * + * * @return The XPath expression to select the signature parent element. */ - public String getXPathExpression(); + String getXPathExpression(); + /** * Gets the namespace prefix to URI mapping to use when evaluating the XPath. - * + * * @return The namespace prefix to URI mapping. */ - public Map getNamespaceDeclarations(); + Map getNamespaceDeclarations(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java index 8e6de87..816576a 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; /** * An enveloped signature type of <code>Transform</code>. - * + * * @author Patrick Peck * @version $Id$ */ @@ -34,6 +33,6 @@ public interface EnvelopedSignatureTransform extends Transform { /** * Algorithm URI of the enveloped signature type of <code>Transform</code>. */ - public static final String ENVELOPED_SIGNATURE = - "http://www.w3.org/2000/09/xmldsig#enveloped-signature"; + String ENVELOPED_SIGNATURE = + "http://www.w3.org/2000/09/xmldsig#enveloped-signature"; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java index 557ff21..18e452c 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import java.util.List; @@ -30,22 +29,22 @@ import at.gv.egovernment.moaspss.util.Constants; /** * An exclusive canonicalization type of <code>Transform</code>. - * + * * @author Patrick Peck * @version $Id$ */ public interface ExclusiveCanonicalizationTransform extends Transform { /** Algorithm URI of exclusive canonical XML. */ - public static final String EXCLUSIVE_CANONICAL_XML = Constants.EXC_C14N_URI; + String EXCLUSIVE_CANONICAL_XML = Constants.EXC_C14N_URI; /** Algorithm URI of exclusive canonical XML with comments. */ - public static final String EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS = - Constants.EXC_C14N_WITH_COMMENTS_URI; + String EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS = + Constants.EXC_C14N_WITH_COMMENTS_URI; /** * Sets the namespace prefixes that are handled in the same manner as in * canonical XML. - * + * * @return The inclusive namespace prefixes. */ - public List getInclusiveNamespacePrefixes(); + List getInclusiveNamespacePrefixes(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExtendedCertificateCheckResult.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExtendedCertificateCheckResult.java index 494b216..afc783e 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExtendedCertificateCheckResult.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExtendedCertificateCheckResult.java @@ -1,33 +1,31 @@ package at.gv.egovernment.moa.spss.api.common; -import org.w3c.dom.NodeList; - public interface ExtendedCertificateCheckResult { - /** - * Gets the result code. - * - * @return The result code. - */ - public int getMajorCode(); + /** + * Gets the result code. + * + * @return The result code. + */ + int getMajorCode(); - /** - * Gets descriptive information. - * - * @return Descriptive information. - */ - public String getMajorInfo(); + /** + * Gets descriptive information. + * + * @return Descriptive information. + */ + String getMajorInfo(); - /** - * Gets the result code. - * - * @return The result code. - */ - public int getMinorCode(); + /** + * Gets the result code. + * + * @return The result code. + */ + int getMinorCode(); - /** - * Gets descriptive information. - * - * @return Descriptive information. - */ - public String getMinorInfo(); + /** + * Gets descriptive information. + * + * @return Descriptive information. + */ + String getMinorInfo(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/InputData.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/InputData.java index 8f8a714..b9c75bb 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/InputData.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/InputData.java @@ -21,45 +21,42 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; /** - * Interface specifying accessors for two attributes needed for returning - * <code>HashInputData</code> and <code>ReferenceInputData</code> information - * as part of <code>VerifyXMLSignatureResponse</code>. - * + * Interface specifying accessors for two attributes needed for returning + * <code>HashInputData</code> and <code>ReferenceInputData</code> information as + * part of <code>VerifyXMLSignatureResponse</code>. + * * @author Gregor Karlinger - * + * * @version $Id$ */ -public interface InputData extends Content -{ +public interface InputData extends Content { /** - * Possible value returned by {@link #getPartOf}. + * Possible value returned by {@link #getPartOf}. */ - public static String CONTAINER_SIGNEDINFO_ = "SignedInfo"; + String CONTAINER_SIGNEDINFO_ = "SignedInfo"; /** - * Possible value returned by {@link #getPartOf}. + * Possible value returned by {@link #getPartOf}. */ - public static String CONTAINER_XMLDSIGMANIFEST_ = "XMLDSIGManifest"; - + String CONTAINER_XMLDSIGMANIFEST_ = "XMLDSIGManifest"; + /** * Value returned by {link getReferringReferenceNumber}, signalling that the * attribute is not used. */ - public static int REFERER_NONE_ = -1; - + int REFERER_NONE_ = -1; + /** - * Returns a <code>String</code> signalling what kind of container the - * XMLDSIG <code>Reference</code> this <code>InputData</code> belongs - * to is part of. - * - * @return the kind of container. + * Returns a <code>String</code> signalling what kind of container the XMLDSIG + * <code>Reference</code> this <code>InputData</code> belongs to is part of. + * + * @return the kind of container. */ - public String getPartOf(); - + String getPartOf(); + /** * If this <code>InputData</code> belongs to an XMLDSIG <code>Reference</code> * being part of either a XMLDSIGManifest or a SignatureManifest, this method @@ -67,14 +64,14 @@ public interface InputData extends Content * of the XMLDSIG <code>SignedInfo</code> referring to the XMLDSIGManifest or * SignatureManifest respectively. */ - public int getReferringReferenceNumber(); - - + int getReferringReferenceNumber(); + /** - * Returns an identifier of the hash algorithm that is used to hash this {@link InputData} - * + * Returns an identifier of the hash algorithm that is used to hash this + * {@link InputData} + * * @return */ - public String getHashAlgorithm(); - + String getHashAlgorithm(); + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/MetaInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/MetaInfo.java index 2413229..8c1b270 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/MetaInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/MetaInfo.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import org.w3c.dom.NodeList; /** * Object encapsulating descriptive meta information. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,26 +35,29 @@ import org.w3c.dom.NodeList; public interface MetaInfo { /** * Gets the mime type of the associated object. - * + * * @return The mimetype of the associated object. */ - public String getMimeType(); + String getMimeType(); + /** * Gets the descriptive information (URI). - * + * * @return URI referencing the descriptive information. */ - public String getDescription(); + String getDescription(); + /** * Gets the elemental informations. - * + * * @return The elemental informations. - */ - public NodeList getAnyElements(); + */ + NodeList getAnyElements(); + /** * Gets the XML signature creation type information of the associated object. - * + * * @return the XML signature creation type information of the associated object. */ - public String getType(); + String getType(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/SignerInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/SignerInfo.java index bb3dfdf..07b5f7f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/SignerInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/SignerInfo.java @@ -21,16 +21,14 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import java.security.cert.X509Certificate; import java.util.Date; - /** * Contains information about the signer. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -38,65 +36,69 @@ import java.util.Date; public interface SignerInfo { /** * Gets the signer certificate. - * + * * @return The signer certificate. - */ - public X509Certificate getSignerCertificate(); + */ + X509Certificate getSignerCertificate(); + /** * Checks, whether the certificate contained in this object is qualified. - * + * * @return <code>true</code>, if the certificate is qualified, otherwise - * <code>false</code>. + * <code>false</code>. */ - public boolean isQualifiedCertificate(); - - + boolean isQualifiedCertificate(); + /** * Checks, whether the signature is based on a SSCD. - * + * * @return <code>true</code>, if the signature is based on a SSCD, otherwise - * <code>false</code>. + * <code>false</code>. */ - public boolean isSSCD(); - + boolean isSSCD(); + /** - * Returns the source of the SSCD check (TSL or Certificate) * + * Returns the source of the SSCD check (TSL or Certificate) * */ - public String getSSCDSource(); + String getSSCDSource(); /** - * Returns the source of the QC check (TSL or Certificate) * + * Returns the source of the QC check (TSL or Certificate) * */ - public String getQCSource(); + String getQCSource(); /** * Returns the signer certificate issuer country code + * * @return */ - public String getIssuerCountryCode(); + String getIssuerCountryCode(); + /** - * Checks, whether the certificate contained in this object is a - * public authority certificate. - * - * @return <code>true</code>, if the certificate is a public authority - * certificate, otherwise <code>false</code>. + * Checks, whether the certificate contained in this object is a public + * authority certificate. + * + * @return <code>true</code>, if the certificate is a public authority + * certificate, otherwise <code>false</code>. */ - public boolean isPublicAuthority(); + boolean isPublicAuthority(); + /** - * Gets the public authority ID, if the certificate contained in this - * object is from a public authority. - * + * Gets the public authority ID, if the certificate contained in this object is + * from a public authority. + * * @return The public authority ID. - */ - public String getPublicAuhtorityID(); + */ + String getPublicAuhtorityID(); + + Date getSigningTime(); - public Date getSigningTime(); - /** * Gets information from the Trust-Status List for this certificate - * - * @return {@link TslInfos} if the certificate is on the Trust-Status List, otherwise null + * + * @return {@link TslInfos} if the certificate is on the Trust-Status List, + * otherwise null */ - public TslInfos getTslInfos(); - + TslInfos getTslInfos(); + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/TSLConfiguration.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/TSLConfiguration.java index be6fe4b..8d0a9fa 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/TSLConfiguration.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/TSLConfiguration.java @@ -21,67 +21,64 @@ * that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.api.common;
-
-import iaik.xml.crypto.utils.URI;
-
import java.util.Date;
import java.util.List;
+import iaik.xml.crypto.utils.URI;
/**
* Contains TSL configuration information.
- *
+ *
* @author kstranacher
*/
public interface TSLConfiguration {
-
- /** Default URL of EU TSL */
- public String DEFAULT_EU_TSL_URL = "https://ec.europa.eu/tools/lotl/eu-lotl.xml";
-
- /** Default period (1day=86400000 msec) for update schedule */
- public String DEFAULT_UPDATE_SCHEDULE_PERIOD = "86400000";
-
- /** Default start time (2:00 AM) for update schedule */
- public String DEFAULT_UPDATE_SCHEDULE_STARTTIME = "02:00:00";
-
- public String DEFAULT_WORKING_DIR = "tslworking";
-
+
+ /** Default URL of EU TSL */
+ String DEFAULT_EU_TSL_URL = "https://ec.europa.eu/tools/lotl/eu-lotl.xml";
+
+ /** Default period (1day=86400000 msec) for update schedule */
+ String DEFAULT_UPDATE_SCHEDULE_PERIOD = "86400000";
+
+ /** Default start time (2:00 AM) for update schedule */
+ String DEFAULT_UPDATE_SCHEDULE_STARTTIME = "02:00:00";
+
+ String DEFAULT_WORKING_DIR = "tslworking";
+
/**
* Gets the EU TSL URL.
- *
+ *
* @return The EU TSL URL.
- */
- public String getEuTSLUrl();
+ */
+ String getEuTSLUrl();
/**
- *
+ *
* @return
*/
- public Date getUpdateScheduleStartTime();
-
+ Date getUpdateScheduleStartTime();
+
/**
- *
+ *
* @return
*/
- public long getUpdateSchedulePeriod();
-
+ long getUpdateSchedulePeriod();
+
/**
- *
+ *
* @return
*/
- public String getWorkingDirectory();
-
+ String getWorkingDirectory();
+
/**
- *
+ *
* @return
*/
- public URI getWorkingDirectoryAsURI();
-
- public List<java.net.URI> getQualifierForQC();
+ URI getWorkingDirectoryAsURI();
+
+ List<java.net.URI> getQualifierForQC();
- public List<java.net.URI> getQualifierForSSCD();
+ List<java.net.URI> getQualifierForSSCD();
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Transform.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Transform.java index ad050b4..5b924c3 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Transform.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/Transform.java @@ -21,20 +21,19 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; /** * Base class for XMLDsig <code>Transform</code> elements. - * + * * @author Patrick Peck * @version $Id$ */ public interface Transform { /** * Gets the algorithm URI of this <code>Transform</code>. - * + * * @return The algorithm URI of this <code>Transform</code>. */ - public String getAlgorithmURI(); + String getAlgorithmURI(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/TslInfos.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/TslInfos.java index 2a04f96..34d28c4 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/TslInfos.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/TslInfos.java @@ -3,47 +3,49 @@ package at.gv.egovernment.moa.spss.api.common; import java.util.List; /** - * Trust-Status list information for a specific certificate - * All informations and identifiers are according to the Trust-Status List specification - * + * Trust-Status list information for a specific certificate All informations and + * identifiers are according to the Trust-Status List specification + * * @author tlenz * */ public interface TslInfos { - /** - * Gets the issuer country of the TSL - * - * @return - */ - public String getTslIssuerCountry(); - - /** - * Gets the Service-Type Status of the TSP, which issues the analyzed certificate - * - * @return - */ - public String getServiceTypeStatus(); - - /** - * Gets the Service-Type Identifier of the TSP, which issues the analyzed certificate - * - * @return - */ - public String getServiceTypeIdentifier(); - - /** - * Gets additional qualifiers for the analyzed certificate - * - * @return - */ - public List<String> getQualifiers(); - - /** - * Gets additional service information for the analyzed certificate - * - * @return - */ - public List<String> getAdditionalServiceInformation(); - + /** + * Gets the issuer country of the TSL + * + * @return + */ + String getTslIssuerCountry(); + + /** + * Gets the Service-Type Status of the TSP, which issues the analyzed + * certificate + * + * @return + */ + String getServiceTypeStatus(); + + /** + * Gets the Service-Type Identifier of the TSP, which issues the analyzed + * certificate + * + * @return + */ + String getServiceTypeIdentifier(); + + /** + * Gets additional qualifiers for the analyzed certificate + * + * @return + */ + List<String> getQualifiers(); + + /** + * Gets additional service information for the analyzed certificate + * + * @return + */ + List<String> getAdditionalServiceInformation(); + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java index 39ec807..007fbe8 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import java.math.BigInteger; /** * Contains an X.509 issuer distinguished name/serial number pair. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,14 +35,15 @@ import java.math.BigInteger; public interface X509IssuerSerial { /** * Gets the issuer distinguished name. - * + * * @return The issuer distinguished name. */ - public String getX509IssuerName(); + String getX509IssuerName(); + /** * Gets the issuer serial number. - * + * * @return The issuer serial number. */ - public BigInteger getX509SerialNumber(); + BigInteger getX509SerialNumber(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java index fe2a795..7b3f830 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java @@ -21,14 +21,12 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; - /** * Object encapsulating arbitrary content and optional descriptive meta * information. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,14 +34,15 @@ package at.gv.egovernment.moa.spss.api.common; public interface XMLDataObjectAssociation { /** * Gets descriptive meta information. - * + * * @return The descriptive meta information. */ - public MetaInfo getMetaInfo(); + MetaInfo getMetaInfo(); + /** * Gets the actual content. - * + * * @return The content of this association. */ - public Content getContent(); + Content getContent(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter.java index 06a49a2..f3a12dc 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter.java @@ -21,42 +21,43 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import java.util.Map; /** * An XPath expression set operation. - * + * * @author Patrick Peck * @version $Id$ */ public interface XPathFilter { /** Subtract this filter's node set from the resulting node set. */ - public static final String SUBTRACT_TYPE = "subtract"; + String SUBTRACT_TYPE = "subtract"; /** Intersect this filter's node set with the resulting node set. */ - public static final String INTERSECT_TYPE = "intersect"; + String INTERSECT_TYPE = "intersect"; /** Compute the union of this filter's node set and the resulting node set. */ - public static final String UNION_TYPE = "union"; - + String UNION_TYPE = "union"; + /** * Gets the type of this <code>XPathFilter</code>. - * + * * @return The type of this <code>XPathFilter</code>. */ - public String getFilterType(); + String getFilterType(); + /** * Gets the XPath expression for selecting the nodes. - * + * * @return The XPath expression for selecting the nodes. */ - public String getXPathExpression(); + String getXPathExpression(); + /** - * Gets The namespace prefix to URI mapping used during evaluation of the - * XPath expression. - * + * Gets The namespace prefix to URI mapping used during evaluation of the XPath + * expression. + * * @return The namespace prefix to URI mapping. */ - public Map getNamespaceDeclarations(); + Map getNamespaceDeclarations(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java index 6f05710..b5899a4 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java @@ -21,29 +21,28 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import java.util.List; /** * An XPath type of <code>Transform</code> containing multiple filters for - * performing set operations on XPath selections. - * + * performing set operations on XPath selections. + * * @author Patrick Peck * @version $Id$ */ public interface XPathFilter2Transform extends Transform { /** Algorithm URI for the XPath Filter2 <code>Transform</code>. */ - public static final String XPATH_FILTER2 = - "http://www.w3.org/2002/06/xmldsig-filter2"; + String XPATH_FILTER2 = + "http://www.w3.org/2002/06/xmldsig-filter2"; /** - * Gets the <code>XPathFilter</code>s contained in this + * Gets the <code>XPathFilter</code>s contained in this * <code>XPathFilter2Transform</code>. - * + * * @return The <code>XPathFilter</code>s. */ - public List getFilters(); + List getFilters(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathTransform.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathTransform.java index 99eda2a..41227c5 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathTransform.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathTransform.java @@ -21,34 +21,34 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import java.util.Map; /** * A <code>Transform</code> performing an XPath selection. - * + * * @author Patrick Peck * @version $Id$ */ public interface XPathTransform extends Transform { /** Algorithm URI of the XPath <code>Transform</code>. */ - public static final String XPATH = - "http://www.w3.org/TR/1999/REC-xpath-19991116"; + String XPATH = + "http://www.w3.org/TR/1999/REC-xpath-19991116"; /** * Gets the XPath expression used for selection. - * + * * @return The XPath expression used for selection. */ - public String getXPathExpression(); + String getXPathExpression(); + /** - * Gets The namespace prefix to URI mapping used during evaluation of the - * XPath expression. - * + * Gets The namespace prefix to URI mapping used during evaluation of the XPath + * expression. + * * @return The namespace prefix to URI mapping. */ - public Map getNamespaceDeclarations(); - + Map getNamespaceDeclarations(); + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java index 8cb6c8e..bdfd2eb 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java @@ -21,27 +21,26 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.common; import org.w3c.dom.Element; /** * A <code>Transform</code> containing an XSLT stylesheet. - * + * * @author Patrick Peck * @version $Id$ */ public interface XSLTTransform extends Transform { /** Algorithm URI for the XSLT type of <code>Transform</code>. */ - public static final String XSLT = - "http://www.w3.org/TR/1999/REC-xslt-19991116"; + String XSLT = + "http://www.w3.org/TR/1999/REC-xslt-19991116"; /** * Gets the XSLT stylesheet element used for the transformation. - * + * * @return The XSLT stylesheet element used for the transformation. */ - public Element getStylesheet(); + Element getStylesheet(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/AdESFormResultsImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/AdESFormResultsImpl.java index c186c54..46710c0 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/AdESFormResultsImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/AdESFormResultsImpl.java @@ -4,39 +4,39 @@ import at.gv.egovernment.moa.spss.api.xmlverify.AdESFormResults; public class AdESFormResultsImpl implements AdESFormResults { - private Integer code; - private String info; - private String name; - - public synchronized void setCode(Integer code) { - this.code = code; - } - - public synchronized void setInfo(String info) { - this.info = info; - } - - public synchronized void setName(String name) { - this.name = name; - } - - @Override - public Integer getCode() { - return this.code; - } - - @Override - public String getInfo() { - return this.info; - } - - @Override - public String getName() { - return this.name; - } - - @Override - public String toString() { - return "AdESFormResultsImpl [code=" + code + ", info=" + info + ", name=" + name + "]"; - } + private Integer code; + private String info; + private String name; + + public synchronized void setCode(Integer code) { + this.code = code; + } + + public synchronized void setInfo(String info) { + this.info = info; + } + + public synchronized void setName(String name) { + this.name = name; + } + + @Override + public Integer getCode() { + return this.code; + } + + @Override + public String getInfo() { + return this.info; + } + + @Override + public String getName() { + return this.name; + } + + @Override + public String toString() { + return "AdESFormResultsImpl [code=" + code + ", info=" + info + ", name=" + name + "]"; + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java index f708bab..b08c74c 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java @@ -21,20 +21,19 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.Base64Transform; /** * Default implementation of <code>Base64Transform</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class Base64TransformImpl - extends TransformImpl - implements Base64Transform { + extends TransformImpl + implements Base64Transform { /** * Create a new <code>Base64TransformImpl</code> object. diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java index 8dede90..f6c1574 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.io.InputStream; @@ -30,33 +29,35 @@ import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentExcplicit; /** * Default implementation of <code>CMSContentExplicit</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CMSContentExplicitImpl implements CMSContentExcplicit { - + /** The binary content, as a stream. */ private InputStream binaryContent; /** * Sets the binary content as a stream. - * + * * @param content The binary content as a stream. */ public void setBinaryContent(InputStream content) { this.binaryContent = content; } + @Override public InputStream getBinaryContent() { return binaryContent; } /** * Gets the type of content. - * + * * @return EXPLICIT_CONTENT */ + @Override public int getContentType() { return EXPLICIT_CONTENT; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java index fb90c5f..a14ea90 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java @@ -21,40 +21,41 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentReference; /** * Default implementation of <code>CMSContentReference</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CMSContentReferenceImpl implements CMSContentReference { - + /** The reference pointing to the actual data. */ private String reference; /** * Sets the reference URI. - * + * * @param referenceURI The URI pointing to the content data. */ public void setReference(String referenceURI) { this.reference = referenceURI; } + @Override public String getReference() { return reference; } /** * Gets the content type. - * + * * @return REFERENCE_CONTENT */ + @Override public int getContentType() { return REFERENCE_CONTENT; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java index 20a9b56..e9b4fea 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.math.BigDecimal; @@ -32,60 +31,64 @@ import at.gv.egovernment.moa.spss.api.common.MetaInfo; /** * Default implementation of <code>CMLSDataObject</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CMSDataObjectImpl implements CMSDataObject { - + /** The <code>MetaInfo</code> associated with the CMS data object. */ private MetaInfo metaInfo; /** The <code>CMSContent</code> contained in this data object. */ private CMSContent cmsContent; - + private BigDecimal excludeByteRangeFrom; private BigDecimal excludeByteRangeTo; /** * Sets the meta information associated with the CMS data object. - * + * * @param metaInfo The meta information. */ public void setMetaInfo(MetaInfo metaInfo) { this.metaInfo = metaInfo; } + @Override public MetaInfo getMetaInfo() { return metaInfo; } /** * Sets the data of this <code>CMSDataObject</code>. - * + * * @param cmsContent The actual data of this <code>CMSDataObject</code>. */ public void setContent(CMSContent cmsContent) { this.cmsContent = cmsContent; } + @Override public CMSContent getContent() { return cmsContent; } public void setExcludeByteRangeFrom(BigDecimal excludeByteRangeFrom) { - this.excludeByteRangeFrom = excludeByteRangeFrom; + this.excludeByteRangeFrom = excludeByteRangeFrom; } - + + @Override public BigDecimal getExcludeByteRangeFrom() { - return excludeByteRangeFrom; + return excludeByteRangeFrom; } - + public void setExcludeByteRangeTo(BigDecimal excludeByteRangeTo) { - this.excludeByteRangeTo = excludeByteRangeTo; + this.excludeByteRangeTo = excludeByteRangeTo; } - + + @Override public BigDecimal getExcludeByteRangeTo() { - return excludeByteRangeTo; - } - + return excludeByteRangeTo; + } + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSSignatureResponseImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSSignatureResponseImpl.java index b512dd0..77ef137 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSSignatureResponseImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSSignatureResponseImpl.java @@ -21,42 +21,41 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; -import org.w3c.dom.Element; - import at.gv.egovernment.moa.spss.api.cmssign.CMSSignatureResponse; /** * Default implementation of <code>CMSSignatureResponse</code>. - * + * * @version $Id$ */ public class CMSSignatureResponseImpl - implements CMSSignatureResponse { + implements CMSSignatureResponse { /** The base64 value of the CMS signature. */ private String cmsSignature; - /** + /** * Sets the CMS signature. - * + * * @param cmsSignature The Base64 encoded value CMS signature. */ public void setCMSSignature(String cmsSignature) { this.cmsSignature = cmsSignature; } + @Override public String getCMSSignature() { return cmsSignature; } /** * Gets the type of <code>CreateCMSSignatureResponseElement</code>. - * + * * @return CMS_SIGNATURE */ + @Override public int getResponseType() { return CMS_SIGNATURE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java index f8efe26..e931c4b 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java @@ -21,26 +21,25 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.CanonicalizationTransform; /** * Default implementation of <code>CanonicalizationTransform</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CanonicalizationTransformImpl - extends TransformImpl - implements CanonicalizationTransform { - + extends TransformImpl + implements CanonicalizationTransform { + /** * Create a new <code>CanonicalizationTransformImpl</code> object. - * - * @param algorithmURI Algorithm URI of the canonicalization - * <code>Transform</code> type. + * + * @param algorithmURI Algorithm URI of the canonicalization + * <code>Transform</code> type. */ public CanonicalizationTransformImpl(String algorithmURI) { setAlgorithmURI(algorithmURI); diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java index 5bb6e60..a57c4e6 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import org.w3c.dom.NodeList; @@ -30,20 +29,20 @@ import at.gv.egovernment.moa.spss.api.common.CheckResult; /** * Default implementation of <code>CheckResult</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CheckResultImpl implements CheckResult { /** The result code. */ private int code; - - /** Additional information. */ + + /** Additional information. */ private NodeList info; /** * Sets a result code. - * + * * @param code The result code. */ public void setCode(int code) { @@ -53,13 +52,14 @@ public class CheckResultImpl implements CheckResult { /** * @see at.gv.egovernment.moa.spss.api.common.CheckResult#getCode() */ + @Override public int getCode() { return code; } /** * Sets a descriptive information. - * + * * @param info The descriptive information. */ public void setInfo(NodeList info) { @@ -69,6 +69,7 @@ public class CheckResultImpl implements CheckResult { /** * @see at.gv.egovernment.moa.spss.api.common.CheckResult#getInfo() */ + @Override public NodeList getInfo() { return info; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java index 7fe1cf9..aa49375 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.io.InputStream; @@ -30,33 +29,35 @@ import at.gv.egovernment.moa.spss.api.common.ContentBinary; /** * Default implementation of <code>ContentBinary</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class ContentBinaryImpl extends ContentImpl implements ContentBinary { - /** The binary content as a stream. */ + /** The binary content as a stream. */ private InputStream binaryContent; /** * Sets the binary content as a stream. - * + * * @param binaryContent The binary content as a stream. */ public void setBinaryContent(InputStream binaryContent) { this.binaryContent = binaryContent; } + @Override public InputStream getBinaryContent() { return binaryContent; } /** * Gets the type of content. - * + * * @return BINARY_CONTENT */ + @Override public int getContentType() { return BINARY_CONTENT; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java index d061747..4c73795 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.Content; /** * Default base class for <code>Content</code> implementations. - * + * * @author Patrick Peck * @version $Id$ */ @@ -38,13 +37,14 @@ public abstract class ContentImpl implements Content { /** * Sets the reference pointing to the content data. - * + * * @param referenceURI The URI of the content data. */ public void setReference(String referenceURI) { this.reference = referenceURI; } + @Override public String getReference() { return reference; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java index aa01a93..7d763c1 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java @@ -21,47 +21,47 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.ContentLocRef; /** * Default implementation of <code>ContentLocRef</code>. - * + * * @author Gregor Karlinger * @version $Id$ */ -public class ContentLocRefImpl extends ContentImpl implements ContentLocRef -{ +public class ContentLocRefImpl extends ContentImpl implements ContentLocRef { /** - * The location reference URI pointing to the actual remote location of the content. + * The location reference URI pointing to the actual remote location of the + * content. */ private String locationReferenceURI_; - - /** + + /** * @see at.gv.egovernment.moa.spss.api.common.ContentLocRef#getLocationReferenceURI() */ - public String getLocationReferenceURI() - { + @Override + public String getLocationReferenceURI() { return locationReferenceURI_; } - + /** - * Sets the location reference URI pointing to the actual remote location of the content. - * + * Sets the location reference URI pointing to the actual remote location of the + * content. + * * @param locationReferenceURI the location reference URI. */ - public void setLocationReferenceURI(String locationReferenceURI) - { + public void setLocationReferenceURI(String locationReferenceURI) { locationReferenceURI_ = locationReferenceURI; } - + /** * Gets the type of content. - * + * * @return LOCREF_CONTENT. */ + @Override public int getContentType() { return LOCREF_CONTENT; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java index ab5c3b4..de0e1cf 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java @@ -21,26 +21,26 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.ContentReference; /** * Default implementation of <code>ContentReference</code>. - * + * * @author Patrick Peck * @version $Id$ */ public class ContentReferenceImpl - extends ContentImpl - implements ContentReference { + extends ContentImpl + implements ContentReference { /** * Gets the type of content. - * + * * @return REFERENCE_CONTENT */ + @Override public int getContentType() { return REFERENCE_CONTENT; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java index dcc1935..496550f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import org.w3c.dom.NodeList; @@ -30,7 +29,7 @@ import at.gv.egovernment.moa.spss.api.common.ContentXML; /** * Default implementation of <code>ContentXML</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -38,25 +37,27 @@ public class ContentXMLImpl extends ContentImpl implements ContentXML { /** The nodes making up the XML content. */ private NodeList xmlContent; - + /** * Sets the nodes making up the XML content. - * + * * @param xmlContent The XML content. */ public void setXMLContent(NodeList xmlContent) { this.xmlContent = xmlContent; } + @Override public NodeList getXMLContent() { return xmlContent; } /** * Gets the type of content. - * + * * @return XML_CONTENT */ + @Override public int getContentType() { return XML_CONTENT; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateCMSSignatureRequestImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateCMSSignatureRequestImpl.java index e8408bc..dcdb77f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateCMSSignatureRequestImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateCMSSignatureRequestImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,44 +31,46 @@ import at.gv.egovernment.moa.spss.api.cmssign.CreateCMSSignatureRequest; /** * Default implementation of <code>CreateCMSSignatureRequest</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CreateCMSSignatureRequestImpl - implements CreateCMSSignatureRequest { + implements CreateCMSSignatureRequest { - /** The identifier for selecting the private keys for creating the signature.*/ + /** The identifier for selecting the private keys for creating the signature. */ private String keyIdentifier; /** Information for creating a single signature. */ private List singleSignatureInfos = new ArrayList(); /** - * Sets the identifier for selecting the private keys for creating the + * Sets the identifier for selecting the private keys for creating the * signature. - * + * * @param keyIdentifier The identifier for selecting the private keys. */ public void setKeyIdentifier(String keyIdentifier) { this.keyIdentifier = keyIdentifier; } + @Override public String getKeyIdentifier() { return keyIdentifier; } /** * Sets the information for creating single signatures. - * + * * @param singleSignaureInfos The information for creating single signatures. */ public void setSingleSignatureInfos(List singleSignaureInfos) { this.singleSignatureInfos = - singleSignaureInfos != null - ? Collections.unmodifiableList(new ArrayList(singleSignaureInfos)) - : null; + singleSignaureInfos != null + ? Collections.unmodifiableList(new ArrayList(singleSignaureInfos)) + : null; } + @Override public List getSingleSignatureInfos() { return singleSignatureInfos; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateCMSSignatureResponseImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateCMSSignatureResponseImpl.java index d596058..ae64195 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateCMSSignatureResponseImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateCMSSignatureResponseImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,27 +31,28 @@ import at.gv.egovernment.moa.spss.api.cmssign.CreateCMSSignatureResponse; /** * Default implementation of <code>CreateCMSSignatureResponse</code>. - * + * * @version $Id$ */ public class CreateCMSSignatureResponseImpl - implements CreateCMSSignatureResponse { + implements CreateCMSSignatureResponse { /** The elements contained in the response. */ private List responseElements = new ArrayList(); /** * Sets the elements contained in the response. - * + * * @param responseElements The response elements. */ public void setResponseElements(List responseElements) { this.responseElements = - responseElements != null - ? Collections.unmodifiableList(new ArrayList(responseElements)) - : null; + responseElements != null + ? Collections.unmodifiableList(new ArrayList(responseElements)) + : null; } + @Override public List getResponseElements() { return responseElements; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java index 9fe8eaf..3d5279f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,14 +31,14 @@ import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileE import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; /** - * Default implementation of + * Default implementation of * <codeCreateSignatureEnvironmentProfileExplicit</code>. - * + * * @author Patrick Peck * @version $Id$ */ public class CreateSignatureEnvironmentProfileExplicitImpl - implements CreateSignatureEnvironmentProfileExplicit { + implements CreateSignatureEnvironmentProfileExplicit { /** The insertion location of the signature to be created. */ private CreateSignatureLocation createSignatureLocation; @@ -49,40 +48,42 @@ public class CreateSignatureEnvironmentProfileExplicitImpl /** * Sets the insertion location of the signature to be created. - * - * @param createSignatureLocation The insertion location of the signature to - * be created. + * + * @param createSignatureLocation The insertion location of the signature to be + * created. */ public void setCreateSignatureLocation(CreateSignatureLocation createSignatureLocation) { this.createSignatureLocation = createSignatureLocation; } + @Override public CreateSignatureLocation getCreateSignatureLocation() { return createSignatureLocation; } /** - * Sets the supplemental information for evaluating the signature - * environment. - * + * Sets the supplemental information for evaluating the signature environment. + * * @param supplements The supplemental information. */ public void setSupplements(List supplements) { this.supplements = - supplements != null - ? Collections.unmodifiableList(new ArrayList(supplements)) - : null; + supplements != null + ? Collections.unmodifiableList(new ArrayList(supplements)) + : null; } + @Override public List getSupplements() { return supplements; } /** * Gets the type of profile. - * + * * @return EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE */ + @Override public int getCreateSignatureEnvironmentProfileType() { return EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java index 5edbf4f..4818f9e 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java @@ -21,41 +21,42 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileID; /** * Default implementation of <code>CreateSignatureEnvironmentProfileID</code>. - * + * * @author Patrick Peck * @version $Id$ */ public class CreateSignatureEnvironmentProfileIDImpl - implements CreateSignatureEnvironmentProfileID { + implements CreateSignatureEnvironmentProfileID { /** The profile ID. */ private String createSignatureEnvironmentProfileID; /** * Sets the profile ID. - * + * * @param profileID The profile ID. */ public void setCreateSignatureEnvironmentProfileID(String profileID) { this.createSignatureEnvironmentProfileID = profileID; } + @Override public String getCreateSignatureEnvironmentProfileID() { return createSignatureEnvironmentProfileID; } /** * Gets the type of profile. - * + * * @return ID_CREATESIGNATUREENVIRONMENTPROFILE */ + @Override public int getCreateSignatureEnvironmentProfileType() { return ID_CREATESIGNATUREENVIRONMENTPROFILE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java index 7111633..7a97cd5 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.Content; @@ -30,29 +29,30 @@ import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; /** * Default implementation of <code>CreateSignatureInfo</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CreateSignatureInfoImpl implements CreateSignatureInfo { - - /** The signature environment that will contain the newly created - * signature. */ + + /** + * The signature environment that will contain the newly created signature. + */ private Content createSignatureEnvironment; /** Additional information about the signature environment. */ private CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile; /** - * Sets the signature environment that will contain the newly created - * signature. - * + * Sets the signature environment that will contain the newly created signature. + * * @param createSignatureEnvironment The signature environment. */ public void setCreateSignatureEnvironment(Content createSignatureEnvironment) { this.createSignatureEnvironment = createSignatureEnvironment; } + @Override public Content getCreateSignatureEnvironment() { return createSignatureEnvironment; } @@ -60,13 +60,14 @@ public class CreateSignatureInfoImpl implements CreateSignatureInfo { /** * Sets the signature environment profile containing additional information * about the signature environment. - * + * * @param profile The signature environment profile. */ public void setCreateSignatureEnvironmentProfile(CreateSignatureEnvironmentProfile profile) { this.createSignatureEnvironmentProfile = profile; } + @Override public CreateSignatureEnvironmentProfile getCreateSignatureEnvironmentProfile() { return createSignatureEnvironmentProfile; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java index 6f3101f..121dcf0 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java @@ -21,33 +21,33 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; /** * Default implementation of <code>CreateSignatureLocation</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CreateSignatureLocationImpl - extends ElementSelectorImpl - implements CreateSignatureLocation { + extends ElementSelectorImpl + implements CreateSignatureLocation { /** The index of the newly created signature. */ private int index; /** * Sets the index of the newly created signature. - * + * * @param index The index of the newly created signature. */ public void setIndex(int index) { this.index = index; } + @Override public int getIndex() { return index; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java index d53f103..24e4abc 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -33,7 +32,7 @@ import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; /** * Default implementation of <code>CreateTransformsInfo</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -45,29 +44,31 @@ public class CreateTransformsInfoImpl implements CreateTransformsInfo { /** * Sets the transforms. - * + * * @param transforms The transforms. */ public void setTransforms(List transforms) { this.transforms = - transforms != null - ? Collections.unmodifiableList(new ArrayList(transforms)) - : null; + transforms != null + ? Collections.unmodifiableList(new ArrayList(transforms)) + : null; } + @Override public List getTransforms() { return transforms; } /** * Sets the meta information about the data resulting from the transforms. - * + * * @param finalDataMetaInfo The meta information. */ public void setFinalDataMetaInfo(MetaInfo finalDataMetaInfo) { this.finalDataMetaInfo = finalDataMetaInfo; } + @Override public MetaInfo getFinalDataMetaInfo() { return finalDataMetaInfo; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java index b6b9d52..3ffc8e3 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -33,12 +32,12 @@ import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplici /** * Default implementation of <code>CreateTransformsInfoProfileExplicit</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CreateTransformsInfoProfileExplicitImpl - implements CreateTransformsInfoProfileExplicit { + implements CreateTransformsInfoProfileExplicit { /** Transformation information. */ private CreateTransformsInfo transformsInfo; @@ -47,38 +46,41 @@ public class CreateTransformsInfoProfileExplicitImpl /** * Sets the transformation information. - * + * * @param transformsInfo The transformation information. */ public void setCreateTransformsInfo(CreateTransformsInfo transformsInfo) { this.transformsInfo = transformsInfo; } + @Override public CreateTransformsInfo getCreateTransformsInfo() { return transformsInfo; } /** * Sets the additional data for the transformations. - * + * * @param supplements The additional data. */ public void setSupplements(List supplements) { this.supplements = - supplements != null - ? Collections.unmodifiableList(new ArrayList(supplements)) - : null; + supplements != null + ? Collections.unmodifiableList(new ArrayList(supplements)) + : null; } + @Override public List getSupplements() { return supplements; } /** * Gets the type of profile. - * + * * @return EXPLICIT_CREATETRANSFORMSINFOPROFILE */ + @Override public int getCreateTransformsInfoProfileType() { return EXPLICIT_CREATETRANSFORMSINFOPROFILE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java index 55d0ca6..e86c7de 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java @@ -21,40 +21,42 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileID; /** * Default implementation of <code>CreateTransformsInfoProfileID</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CreateTransformsInfoProfileIDImpl - implements CreateTransformsInfoProfileID { + implements CreateTransformsInfoProfileID { /** The profile ID. */ private String createTransformsID; /** * Sets the profile ID. + * * @param createTransformsID The profile ID. */ public void setCreateTransformsInfoProfileID(String createTransformsID) { this.createTransformsID = createTransformsID; } + @Override public String getCreateTransformsInfoProfileID() { return createTransformsID; } /** * Gets the type of profile. - * + * * @return ID_CREATETRANSFORMSINFOPROFILE */ + @Override public int getCreateTransformsInfoProfileType() { return ID_CREATETRANSFORMSINFOPROFILE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java index aaffaa7..30779a3 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,44 +31,46 @@ import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; /** * Default implementation of <code>CreateXMLSignatureRequest</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CreateXMLSignatureRequestImpl - implements CreateXMLSignatureRequest { + implements CreateXMLSignatureRequest { - /** The identifier for selecting the private keys for creating the signature.*/ + /** The identifier for selecting the private keys for creating the signature. */ private String keyIdentifier; /** Information for creating a single signature. */ private List singleSignatureInfos = new ArrayList(); /** - * Sets the identifier for selecting the private keys for creating the + * Sets the identifier for selecting the private keys for creating the * signature. - * + * * @param keyIdentifier The identifier for selecting the private keys. */ public void setKeyIdentifier(String keyIdentifier) { this.keyIdentifier = keyIdentifier; } + @Override public String getKeyIdentifier() { return keyIdentifier; } /** * Sets the information for creating single signatures. - * + * * @param singleSignaureInfos The information for creating single signatures. */ public void setSingleSignatureInfos(List singleSignaureInfos) { this.singleSignatureInfos = - singleSignaureInfos != null - ? Collections.unmodifiableList(new ArrayList(singleSignaureInfos)) - : null; + singleSignaureInfos != null + ? Collections.unmodifiableList(new ArrayList(singleSignaureInfos)) + : null; } + @Override public List getSingleSignatureInfos() { return singleSignatureInfos; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java index 7a8359f..80cd6dc 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,28 +31,29 @@ import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; /** * Default implementation of <code>CreateXMLSignatureResponse</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class CreateXMLSignatureResponseImpl - implements CreateXMLSignatureResponse { + implements CreateXMLSignatureResponse { /** The elements contained in the response. */ private List responseElements = new ArrayList(); /** * Sets the elements contained in the response. - * + * * @param responseElements The response elements. */ public void setResponseElements(List responseElements) { this.responseElements = - responseElements != null - ? Collections.unmodifiableList(new ArrayList(responseElements)) - : null; + responseElements != null + ? Collections.unmodifiableList(new ArrayList(responseElements)) + : null; } + @Override public List getResponseElements() { return responseElements; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoCMSImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoCMSImpl.java index 702086b..f65816a 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoCMSImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoCMSImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo; @@ -29,7 +28,7 @@ import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; /** * Default implementation of <code>DataObjectInfo</code> for CMS. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -41,27 +40,28 @@ public class DataObjectInfoCMSImpl implements DataObjectInfo { /** * Sets the signature structure type. - * + * * @param structure The signature structure type. */ public void setStructure(String structure) { this.stucture = structure; } + @Override public String getStructure() { return stucture; } - /** * Sets the data object to be signed. - * + * * @param dataObject The data object to be signed. */ public void setDataObject(CMSDataObject dataObject) { this.dataObject = dataObject; } + @Override public CMSDataObject getDataObject() { return dataObject; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java index 7a25a97..4099d89 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.Content; @@ -30,15 +29,16 @@ import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; /** * Default implementation of <code>DataObjectInfo</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class DataObjectInfoImpl implements DataObjectInfo { /** The signature structure type. */ private String stucture; - /** Whether a reference will be placed in the signature itself or in the - * manifest */ + /** + * Whether a reference will be placed in the signature itself or in the manifest + */ private boolean childOfManifest; /** The data object to be signed. */ private Content dataObject; @@ -47,13 +47,14 @@ public class DataObjectInfoImpl implements DataObjectInfo { /** * Sets the signature structure type. - * + * * @param structure The signature structure type. */ public void setStructure(String structure) { this.stucture = structure; } + @Override public String getStructure() { return stucture; } @@ -61,41 +62,44 @@ public class DataObjectInfoImpl implements DataObjectInfo { /** * Sets whether a reference will be placed in the signature itself or in the * manifest. - * - * @param childOfManifest Whether to put the reference in the signature of - * in the manifest. + * + * @param childOfManifest Whether to put the reference in the signature of in + * the manifest. */ public void setChildOfManifest(boolean childOfManifest) { this.childOfManifest = childOfManifest; } + @Override public boolean isChildOfManifest() { return childOfManifest; } /** * Sets the data object to be signed. - * + * * @param dataObject The data object to be signed. */ public void setDataObject(Content dataObject) { this.dataObject = dataObject; } + @Override public Content getDataObject() { return dataObject; } /** * Sets additional information for the transformations. - * + * * @param profile The profile containing additional information for the - * transformations. + * transformations. */ public void setCreateTransformsInfoProfile(CreateTransformsInfoProfile profile) { this.createTransformsInfoProfile = profile; } + @Override public CreateTransformsInfoProfile getCreateTransformsInfoProfile() { return createTransformsInfoProfile; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java index 7de0660..e505440 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.HashMap; @@ -31,7 +30,7 @@ import at.gv.egovernment.moa.spss.api.common.ElementSelector; /** * Default implementation of <code>ElementSelector</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -43,27 +42,29 @@ public class ElementSelectorImpl implements ElementSelector { /** * Sets the XPath expression pointing to the element. - * + * * @param xPathExpression XPath expression pointing to the element. */ public void setXPathExpression(String xPathExpression) { this.xPathExpression = xPathExpression; } + @Override public String getXPathExpression() { return xPathExpression; } /** * Sets namespace declarations to apply for evaluating the XPath. - * - * @param namespaceDeclarations The namespace declarations to apply for - * evaluating the XPath. + * + * @param namespaceDeclarations The namespace declarations to apply for + * evaluating the XPath. */ public void setNamespaceDeclarations(Map namespaceDeclarations) { this.namespaceDeclarations = namespaceDeclarations; } + @Override public Map getNamespaceDeclarations() { return namespaceDeclarations; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java index 121037f..40a579b 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java @@ -21,20 +21,19 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.EnvelopedSignatureTransform; /** * Default implementation of <code>EnvelopedSignatureTransform</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class EnvelopedSignatureTransformImpl - extends TransformImpl - implements EnvelopedSignatureTransform { + extends TransformImpl + implements EnvelopedSignatureTransform { /** * Create a <code>EnvelopedSignatureTransformImpl</code>. diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java index a2a59a7..e55b69b 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; /** * Default implementation of <code>ErrorResponse</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -40,35 +39,38 @@ public class ErrorResponseImpl implements ErrorResponse { /** * Sets the error code. - * + * * @param code The error code. */ public void setErrorCode(int code) { this.code = code; } + @Override public int getErrorCode() { return code; } /** * Sets the verbose error information. - * + * * @param info The verbose error information. */ public void setInfo(String info) { this.info = info; } + @Override public String getInfo() { return info; } /** * Gets the response type. - * - * @return ERROR_RESPONSE + * + * @return ERROR_RESPONSE */ + @Override public int getResponseType() { return ERROR_RESPONSE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java index eea09c0..fd0e276 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,22 +31,22 @@ import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; /** * Default implementation of <code>ExclusiveCanonicalizationTransform</code>. - * + * * @author Patrick Peck * @version $Id$ */ public class ExclusiveCanonicalizationTransformImpl - extends TransformImpl - implements ExclusiveCanonicalizationTransform { + extends TransformImpl + implements ExclusiveCanonicalizationTransform { /** The namespaces to treat according to canonical XML. */ private List inclusiveNamespacePrefixes; - - /** + + /** * Create a <code>ExclusiveCanonicalizationTransformImpl</code> object. - * + * * @param algorithmURI The algorithm URI identifying the transformation - * algorithm. + * algorithm. */ public ExclusiveCanonicalizationTransformImpl(String algorithmURI) { setAlgorithmURI(algorithmURI); @@ -55,16 +54,18 @@ public class ExclusiveCanonicalizationTransformImpl /** * Sets the namespaces to treat according to canonical XML. - * @param inclusiveNamespacePrefixes The namespaces to treat according to - * canonical XML. + * + * @param inclusiveNamespacePrefixes The namespaces to treat according to + * canonical XML. */ public void setInclusiveNamespacePrefixes(List inclusiveNamespacePrefixes) { this.inclusiveNamespacePrefixes = - inclusiveNamespacePrefixes != null - ? Collections.unmodifiableList(new ArrayList(inclusiveNamespacePrefixes)) - : null; + inclusiveNamespacePrefixes != null + ? Collections.unmodifiableList(new ArrayList(inclusiveNamespacePrefixes)) + : null; } + @Override public List getInclusiveNamespacePrefixes() { return inclusiveNamespacePrefixes; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExtendedCertificateCheckResultImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExtendedCertificateCheckResultImpl.java index f36760c..21db8e0 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExtendedCertificateCheckResultImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExtendedCertificateCheckResultImpl.java @@ -3,42 +3,42 @@ package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.ExtendedCertificateCheckResult; public class ExtendedCertificateCheckResultImpl implements ExtendedCertificateCheckResult { - private int majorCode; - private String majorInfo; - - private int minorCode; - private String minorInfo; - - public ExtendedCertificateCheckResultImpl(int majorCode, String majorInfo) { - this(majorCode, majorInfo, -1, ""); - } - - public ExtendedCertificateCheckResultImpl(int majorCode, String majorInfo, - int minorCode, String minorInfo) { - this.majorCode = majorCode; - this.majorInfo = majorInfo; - this.minorCode = minorCode; - this.minorInfo = minorInfo; - } - - @Override - public int getMajorCode() { - return this.majorCode; - } - - @Override - public String getMajorInfo() { - return this.majorInfo; - } - - @Override - public int getMinorCode() { - return this.minorCode; - } - - @Override - public String getMinorInfo() { - return this.minorInfo; - } + private final int majorCode; + private final String majorInfo; + + private final int minorCode; + private final String minorInfo; + + public ExtendedCertificateCheckResultImpl(int majorCode, String majorInfo) { + this(majorCode, majorInfo, -1, ""); + } + + public ExtendedCertificateCheckResultImpl(int majorCode, String majorInfo, + int minorCode, String minorInfo) { + this.majorCode = majorCode; + this.majorInfo = majorInfo; + this.minorCode = minorCode; + this.minorInfo = minorInfo; + } + + @Override + public int getMajorCode() { + return this.majorCode; + } + + @Override + public String getMajorInfo() { + return this.majorInfo; + } + + @Override + public int getMinorCode() { + return this.minorCode; + } + + @Override + public String getMinorInfo() { + return this.minorInfo; + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java index 4b5659e..a806f16 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.io.InputStream; @@ -32,102 +31,104 @@ import at.gv.egovernment.moa.spss.api.common.ContentBinary; import at.gv.egovernment.moa.spss.api.common.InputData; /** - * Content wrapper decorating a binary content with two additional attributes + * Content wrapper decorating a binary content with two additional attributes * needed for returning <code>HashInputData</code> and <code>ReferenceInputData * </code> information as part of <code>VerifyXMLSignatureResponse</code>. - * + * * @author Gregor Karlinger - * + * * @version $Id$ */ -public class InputDataBinaryImpl implements ContentBinary, InputData -{ +public class InputDataBinaryImpl implements ContentBinary, InputData { /** * The wrapped <code>Content</code>. */ protected ContentBinary wrapped_; - + /** - * This attribute signals what kind of container the XMLDSIG <code>Reference</code> - * this <code>InputData</code> belongs to is part of. + * This attribute signals what kind of container the XMLDSIG + * <code>Reference</code> this <code>InputData</code> belongs to is part of. */ protected String partOf_; - + /** * If this <code>InputData</code> belongs to an XMLDSIG <code>Reference</code> * being part of either a XMLDSIGManifest or a SignatureManifest, this attribute - * (a positive int) signals the particular <code>Reference</code> of the XMLDSIG + * (a positive int) signals the particular <code>Reference</code> of the XMLDSIG * <code>SignedInfo</code> referring to the XMLDSIGManifest or SignatureManifest * respectively. */ protected int referringReferenceNumber_; - + protected String hashAlg = null; - + /** * Creates a new instance. - * - * @param wrapped The wrapped <code>Content</code>. Must be of type {@link Content#BINARY_CONTENT}. - * - * @param partOf see {@link InputData} - * + * + * @param wrapped The wrapped <code>Content</code>. Must be of + * type {@link Content#BINARY_CONTENT}. + * + * @param partOf see {@link InputData} + * * @param referringReferenceNumber see {@link InputData} - * - * @param hashAlg see {@link InputData} + * + * @param hashAlg see {@link InputData} */ - public InputDataBinaryImpl(Content wrapped, String partOf, int referringReferenceNumber, String hashAlg) throws MOARuntimeException - { - if (wrapped.getContentType() != Content.BINARY_CONTENT) throw new MOARuntimeException("9901", null); - + public InputDataBinaryImpl(Content wrapped, String partOf, int referringReferenceNumber, String hashAlg) + throws MOARuntimeException { + if (wrapped.getContentType() != Content.BINARY_CONTENT) { + throw new MOARuntimeException("9901", null); + } + wrapped_ = (ContentBinary) wrapped; - partOf_ = partOf; + partOf_ = partOf; referringReferenceNumber_ = referringReferenceNumber; - this.hashAlg = hashAlg; + this.hashAlg = hashAlg; } - - /** + + /** * @see at.gv.egovernment.moa.spss.api.common.Content#getContentType() */ - public int getContentType() - { + @Override + public int getContentType() { return wrapped_.getContentType(); } /** * @see at.gv.egovernment.moa.spss.api.common.Content#getReference() */ - public String getReference() - { + @Override + public String getReference() { return wrapped_.getReference(); } /** * @see at.gv.egovernment.moa.spss.api.common.ContentBinary#getBinaryContent() */ - public InputStream getBinaryContent() - { + @Override + public InputStream getBinaryContent() { return wrapped_.getBinaryContent(); } /** * @see at.gv.egovernment.moa.spss.api.common.InputData#getPartOf() */ - public String getPartOf() - { + @Override + public String getPartOf() { return partOf_; } /** * @see at.gv.egovernment.moa.spss.api.common.InputData#getReferringReferenceNumber() */ - public int getReferringReferenceNumber() - { + @Override + public int getReferringReferenceNumber() { return referringReferenceNumber_; } -@Override -public String getHashAlgorithm() { - return this.hashAlg; -} + @Override + public String getHashAlgorithm() { + return this.hashAlg; + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java index e89976e..fd97bf8 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import org.w3c.dom.NodeList; @@ -32,102 +31,103 @@ import at.gv.egovernment.moa.spss.api.common.ContentXML; import at.gv.egovernment.moa.spss.api.common.InputData; /** - * Content wrapper decorating an XML content with two additional attributes + * Content wrapper decorating an XML content with two additional attributes * needed for returning <code>HashInputData</code> and <code>ReferenceInputData * </code> information as part of <code>VerifyXMLSignatureResponse</code>. - * + * * @author Gregor Karlinger - * + * * @version $Id$ */ -public class InputDataXMLImpl implements ContentXML, InputData -{ +public class InputDataXMLImpl implements ContentXML, InputData { /** * The wrapped <code>ContentXML</code>. */ protected ContentXML wrapped_; - + /** - * This attribute signals what kind of container the XMLDSIG <code>Reference</code> - * this <code>InputData</code> belongs to is part of. + * This attribute signals what kind of container the XMLDSIG + * <code>Reference</code> this <code>InputData</code> belongs to is part of. */ protected String partOf_; - + /** * If this <code>InputData</code> belongs to an XMLDSIG <code>Reference</code> * being part of either a XMLDSIGManifest or a SignatureManifest, this attribute - * (a positive int) signals the particular <code>Reference</code> of the XMLDSIG + * (a positive int) signals the particular <code>Reference</code> of the XMLDSIG * <code>SignedInfo</code> referring to the XMLDSIGManifest or SignatureManifest * respectively. */ protected int referringReferenceNumber_; - + protected String hashAlg = null; - + /** * Creates a new instance. - * - * @param wrapped The wrapped <code>ContentBinary</code>. Must be of type {@link Content#XML_CONTENT}. - * - * @param partOf see {@link InputData} - * + * + * @param wrapped The wrapped <code>ContentBinary</code>. Must + * be of type {@link Content#XML_CONTENT}. + * + * @param partOf see {@link InputData} + * * @param referringReferenceNumber see {@link InputData} - * - * @param hashAlg see {@link InputData} + * + * @param hashAlg see {@link InputData} */ - public InputDataXMLImpl(Content wrapped, String partOf, int referringReferenceNumber, String hashAlg) - { - if (wrapped.getContentType() != Content.XML_CONTENT) throw new MOARuntimeException("9901", null); + public InputDataXMLImpl(Content wrapped, String partOf, int referringReferenceNumber, String hashAlg) { + if (wrapped.getContentType() != Content.XML_CONTENT) { + throw new MOARuntimeException("9901", null); + } wrapped_ = (ContentXML) wrapped; - partOf_ = partOf; + partOf_ = partOf; referringReferenceNumber_ = referringReferenceNumber; this.hashAlg = hashAlg; } - - /** + + /** * @see at.gv.egovernment.moa.spss.api.common.Content#getContentType() */ - public int getContentType() - { + @Override + public int getContentType() { return wrapped_.getContentType(); } /** * @see at.gv.egovernment.moa.spss.api.common.Content#getReference() */ - public String getReference() - { + @Override + public String getReference() { return wrapped_.getReference(); } /** * @see at.gv.egovernment.moa.spss.api.common.ContentXML#getXMLContent() */ - public NodeList getXMLContent() - { + @Override + public NodeList getXMLContent() { return wrapped_.getXMLContent(); } /** * @see at.gv.egovernment.moa.spss.api.common.InputData#getPartOf() */ - public String getPartOf() - { + @Override + public String getPartOf() { return partOf_; } /** * @see at.gv.egovernment.moa.spss.api.common.InputData#getReferringReferenceNumber() */ - public int getReferringReferenceNumber() - { + @Override + public int getReferringReferenceNumber() { return referringReferenceNumber_; } -@Override -public String getHashAlgorithm() { - return this.hashAlg; -} + @Override + public String getHashAlgorithm() { + return this.hashAlg; + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java index e5b7f40..752fec0 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; @@ -29,7 +28,7 @@ import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; /** * Default implementation of <code>ManifestRefsCheckResult</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -41,26 +40,28 @@ public class ManifestRefsCheckResultImpl implements ManifestRefsCheckResult { /** * Sets the check code. - * + * * @param code A numerical representation of the result of the manifest check. */ public void setCode(int code) { this.code = code; } + @Override public int getCode() { return code; } /** * Sets a reference to the manifest. - * + * * @param info The reference to the manifest. */ public void setInfo(ManifestRefsCheckResultInfo info) { this.info = info; } + @Override public ManifestRefsCheckResultInfo getInfo() { return info; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java index f0ef1c5..68405a1 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java @@ -21,34 +21,37 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; /** * Default implementation of <code>ManifestRefsCheckResultInfo</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class ManifestRefsCheckResultInfoImpl - extends ReferencesCheckResultInfoImpl - implements ManifestRefsCheckResultInfo { + extends ReferencesCheckResultInfoImpl + implements ManifestRefsCheckResultInfo { - /** The position of the signature reference containing the reference to the - * manifest being described by this object.*/ + /** + * The position of the signature reference containing the reference to the + * manifest being described by this object. + */ private int referringSignatureReference; /** - * Sets the position of the signature reference containing the reference to - * the manifest being described by this object. + * Sets the position of the signature reference containing the reference to the + * manifest being described by this object. + * * @param referringSignatureReference The position of the signature reference. */ public void setReferringSignatureReference(int referringSignatureReference) { this.referringSignatureReference = referringSignatureReference; } + @Override public int getReferringSignatureReference() { return referringSignatureReference; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java index e3a06c6..9f6d882 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import org.w3c.dom.NodeList; @@ -30,6 +29,7 @@ import at.gv.egovernment.moa.spss.api.common.MetaInfo; /** * Default implementation of <code>MetaInfo</code>. + * * @author Fatemeh Philippi * @version $Id$ */ @@ -45,55 +45,58 @@ public class MetaInfoImpl implements MetaInfo { /** * Sets the MIME type. - * + * * @param mimeType The MIME type to set. */ public void setMimeType(String mimeType) { this.mimeType = mimeType; } + @Override public String getMimeType() { return mimeType; } /** * Sets the URI pointing to a description of the content. - * + * * @param description The URI pointing to a description of the content. */ public void setDescription(String description) { this.description = description; } + @Override public String getDescription() { return description; } /** * Sets descriptive XML content. - * + * * @param anyElements The elements to set. */ public void setAnyElements(NodeList anyElements) { - this.anyElements = anyElements; + this.anyElements = anyElements; } + @Override public NodeList getAnyElements() { return anyElements; } /** * Sets the XML signature creation type information. - * + * * @param type the XML signature creation type information to set. */ public void setType(String type) { this.type = type; } + @Override public String getType() { return type; } - } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java index 8bd81a7..c9e44f1 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,7 +31,7 @@ import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; /** * Default implementation of <code>ReferenceInfo</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -41,20 +40,21 @@ public class ReferenceInfoImpl implements ReferenceInfo { private List verifyTransformsInfoProfiles; /** - * Sets the transforms profile used for verifying the transforms contained - * in the signature. - * + * Sets the transforms profile used for verifying the transforms contained in + * the signature. + * * @param verifyTransformsInfoProfiles The profiles containing the transforms - * allowed in the signature. + * allowed in the signature. */ public void setVerifyTransformsInfoProfiles(List verifyTransformsInfoProfiles) { this.verifyTransformsInfoProfiles = - verifyTransformsInfoProfiles != null - ? Collections.unmodifiableList( - new ArrayList(verifyTransformsInfoProfiles)) - : null; + verifyTransformsInfoProfiles != null + ? Collections.unmodifiableList( + new ArrayList(verifyTransformsInfoProfiles)) + : null; } + @Override public List getVerifyTransformsInfoProfiles() { return verifyTransformsInfoProfiles; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java index d4cbab0..02e8634 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; @@ -29,7 +28,7 @@ import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; /** * Default implementation of <code>ReferencesCheckResult</code>. - * + * * @author Patrick Peck * @version $Id$ */ @@ -41,30 +40,31 @@ public class ReferencesCheckResultImpl implements ReferencesCheckResult { /** * Sets the check code. - * - * @param code A numerical representation of the result of the reference - * check. + * + * @param code A numerical representation of the result of the reference check. */ public void setCode(int code) { this.code = code; } - + + @Override public int getCode() { return code; } /** * Sets additional information about the reference check. - * - * @param manifestRefsCheckResultInfo Additional information about the - * reference check. + * + * @param manifestRefsCheckResultInfo Additional information about the reference + * check. */ public void setInfo(ReferencesCheckResultInfo manifestRefsCheckResultInfo) { this.info = manifestRefsCheckResultInfo; } - + + @Override public ReferencesCheckResultInfo getInfo() { return info; - } + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java index a696988..a9073ed 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import org.w3c.dom.NodeList; @@ -30,39 +29,42 @@ import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; /** * Default implementation of <code>ReferencesCheckResultInfo</code>. - * + * * @author Patrick Peck * @version $Id$ */ public class ReferencesCheckResultInfoImpl - implements ReferencesCheckResultInfo { + implements ReferencesCheckResultInfo { /** Additional information about the references check. */ private NodeList anyOtherInfo; /** The indexes of the failed references. */ private int[] failedReferences = new int[0]; - + /** * Sets additional information about the references check. + * * @param anyOtherInfo Additional information about the references check. */ public void setAnyOtherInfo(NodeList anyOtherInfo) { this.anyOtherInfo = anyOtherInfo; } - + + @Override public NodeList getAnyOtherInfo() { return anyOtherInfo; } /** * Sets the indexes of the failed references. - * + * * @param failedReferences The indexes of the failed references. */ public void setFailedReferences(int[] failedReferences) { this.failedReferences = failedReferences; } + @Override public int[] getFailedReferences() { return failedReferences; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java index 2525a2f..0831aec 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java @@ -80,491 +80,577 @@ import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; /** * Default implementation of <code>SPSSFactory</code>. - * + * * @author Patrick Peck * @version $Id$ */ public class SPSSFactoryImpl extends SPSSFactory { - public CreateXMLSignatureRequest createCreateXMLSignatureRequest(String keyIdentifier, List singleSignatureInfos) { - CreateXMLSignatureRequestImpl createXMLSignatureRequest = new CreateXMLSignatureRequestImpl(); - createXMLSignatureRequest.setKeyIdentifier(keyIdentifier); - createXMLSignatureRequest.setSingleSignatureInfos(singleSignatureInfos); - return createXMLSignatureRequest; - } - - public CreateCMSSignatureRequest createCreateCMSSignatureRequest(String keyIdentifier, List singleSignatureInfos) { - CreateCMSSignatureRequestImpl createCMSSignatureRequest = new CreateCMSSignatureRequestImpl(); - createCMSSignatureRequest.setKeyIdentifier(keyIdentifier); - createCMSSignatureRequest.setSingleSignatureInfos(singleSignatureInfos); - return createCMSSignatureRequest; - - } - - public CreateCMSSignatureResponse createCreateCMSSignatureResponse(List responseElements) { - CreateCMSSignatureResponseImpl createCMSSignatureResponse = new CreateCMSSignatureResponseImpl(); - createCMSSignatureResponse.setResponseElements(responseElements); - return createCMSSignatureResponse; - } - - public CMSSignatureResponse createCMSSignatureResponse(String base64value) { - CMSSignatureResponseImpl cmsSignatureResponse = new CMSSignatureResponseImpl(); - cmsSignatureResponse.setCMSSignature(base64value); - - return cmsSignatureResponse; - } - - public SingleSignatureInfo createSingleSignatureInfo(List dataObjectInfos, CreateSignatureInfo createSignatureInfo, - boolean securityLayerConform) { - SingleSignatureInfoImpl singleSignatureInfo = new SingleSignatureInfoImpl(); - singleSignatureInfo.setDataObjectInfos(dataObjectInfos); - singleSignatureInfo.setCreateSignatureInfo(createSignatureInfo); - singleSignatureInfo.setSecurityLayerConform(securityLayerConform); - return singleSignatureInfo; - } - - public at.gv.egovernment.moa.spss.api.cmssign.SingleSignatureInfo createSingleSignatureInfoCMS( - at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo dataObjectInfo, boolean securityLayerConform, boolean isPAdESConform) { - SingleSignatureInfoCMSImpl singleSignatureInfo = new SingleSignatureInfoCMSImpl(); - singleSignatureInfo.setDataObjectInfo(dataObjectInfo); - singleSignatureInfo.setSecurityLayerConform(securityLayerConform); - singleSignatureInfo.setPAdESConform(isPAdESConform); - return singleSignatureInfo; - } - - public DataObjectInfo createDataObjectInfo(String structure, boolean childOfManifest, Content dataObject, - CreateTransformsInfoProfile createTransformsInfoProfile) { - DataObjectInfoImpl dataObjectInfo = new DataObjectInfoImpl(); - dataObjectInfo.setStructure(structure); - dataObjectInfo.setChildOfManifest(childOfManifest); - dataObjectInfo.setDataObject(dataObject); - dataObjectInfo.setCreateTransformsInfoProfile(createTransformsInfoProfile); - return dataObjectInfo; - } - - public at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo createDataObjectInfo(String structure, - CMSDataObject dataObject) { - DataObjectInfoCMSImpl dataObjectInfo = new DataObjectInfoCMSImpl(); - dataObjectInfo.setStructure(structure); - dataObjectInfo.setDataObject(dataObject); - return dataObjectInfo; - } - - public CreateTransformsInfoProfile createCreateTransformsInfoProfile(String profileID) { - - CreateTransformsInfoProfileIDImpl createTransformsInfoProfile = new CreateTransformsInfoProfileIDImpl(); - createTransformsInfoProfile.setCreateTransformsInfoProfileID(profileID); - return createTransformsInfoProfile; - } - - public CreateTransformsInfoProfile createCreateTransformsInfoProfile(CreateTransformsInfo transformsInfo, - List supplements) { - CreateTransformsInfoProfileExplicitImpl createTransformsInfoProfile = new CreateTransformsInfoProfileExplicitImpl(); - createTransformsInfoProfile.setCreateTransformsInfo(transformsInfo); - createTransformsInfoProfile.setSupplements(supplements); - return createTransformsInfoProfile; - } - - public CreateTransformsInfo createCreateTransformsInfo(List transforms, MetaInfo finalDataMetaInfo) { - CreateTransformsInfoImpl createTransformsInfo = new CreateTransformsInfoImpl(); - - createTransformsInfo.setTransforms(transforms); - createTransformsInfo.setFinalDataMetaInfo(finalDataMetaInfo); - return createTransformsInfo; - } - - public CreateSignatureInfo createCreateSignatureInfo(Content createSignatureEnvironment, - CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile) { - CreateSignatureInfoImpl createSignatureInfo = new CreateSignatureInfoImpl(); - createSignatureInfo.setCreateSignatureEnvironment(createSignatureEnvironment); - createSignatureInfo.setCreateSignatureEnvironmentProfile(createSignatureEnvironmentProfile); - return createSignatureInfo; - } - - public CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile( - CreateSignatureLocation createSignatureLocation, List supplements) { - CreateSignatureEnvironmentProfileExplicitImpl createSignatureEnvironmentProfile = new CreateSignatureEnvironmentProfileExplicitImpl(); - createSignatureEnvironmentProfile.setCreateSignatureLocation(createSignatureLocation); - createSignatureEnvironmentProfile.setSupplements(supplements); - return createSignatureEnvironmentProfile; - } - - public CreateSignatureLocation createCreateSignatureLocation(String signatureLocationXPath, - int signatureLocationIndex, Map namespaceDeclarations) { - CreateSignatureLocationImpl createSignatureLocation = new CreateSignatureLocationImpl(); - createSignatureLocation.setIndex(signatureLocationIndex); - createSignatureLocation.setNamespaceDeclarations(namespaceDeclarations); - createSignatureLocation.setXPathExpression(signatureLocationXPath); - return createSignatureLocation; - } - - public CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile(String profileID) { - CreateSignatureEnvironmentProfileIDImpl createSignatureEnvironmentProfile = new CreateSignatureEnvironmentProfileIDImpl(); - createSignatureEnvironmentProfile.setCreateSignatureEnvironmentProfileID(profileID); - return createSignatureEnvironmentProfile; - } - - public CreateXMLSignatureResponse createCreateXMLSignatureResponse(List responseElements) { - CreateXMLSignatureResponseImpl createXMLSignatureResponse = new CreateXMLSignatureResponseImpl(); - createXMLSignatureResponse.setResponseElements(responseElements); - return createXMLSignatureResponse; - } - - public SignatureEnvironmentResponse createSignatureEnvironmentResponse(Element signatureEnvironment) { - SignatureEnvironmentResponseImpl signatureEnvironmentResponse = new SignatureEnvironmentResponseImpl(); - signatureEnvironmentResponse.setSignatureEnvironment(signatureEnvironment); - return signatureEnvironmentResponse; - } - - public ErrorResponse createErrorResponse(int code, String info) { - ErrorResponseImpl errorResponse = new ErrorResponseImpl(); - errorResponse.setErrorCode(code); - errorResponse.setInfo(info); - return errorResponse; - } - - public VerifyCMSSignatureRequest createVerifyCMSSignatureRequest(int[] signatories, Date dateTime, - InputStream cmsSignature, CMSDataObject dataObject, String trustProfileID, boolean pdf) { - return this.createVerifyCMSSignatureRequest(signatories, dateTime, cmsSignature, dataObject, trustProfileID, pdf, false); - } - - public VerifyCMSSignatureRequest createVerifyCMSSignatureRequest(int[] signatories, Date dateTime, - InputStream cmsSignature, CMSDataObject dataObject, String trustProfileID, boolean pdf, boolean extended) { - VerifyCMSSignatureRequestImpl verifyCMSSignatureRequest = new VerifyCMSSignatureRequestImpl(); - verifyCMSSignatureRequest.setDateTime(dateTime); - verifyCMSSignatureRequest.setCMSSignature(cmsSignature); - verifyCMSSignatureRequest.setDataObject(dataObject); - verifyCMSSignatureRequest.setTrustProfileId(trustProfileID); - verifyCMSSignatureRequest.setSignatories(signatories); - verifyCMSSignatureRequest.setPDF(pdf); - verifyCMSSignatureRequest.setExtended(extended); - return verifyCMSSignatureRequest; - } - - public CMSDataObject createCMSDataObject(MetaInfo metaInfo, CMSContent content, BigDecimal excludeByteRangeFrom, - BigDecimal excludeByteRangeTo) { - - CMSDataObjectImpl cmsDataObject = new CMSDataObjectImpl(); - cmsDataObject.setMetaInfo(metaInfo); - cmsDataObject.setContent(content); - cmsDataObject.setExcludeByteRangeFrom(excludeByteRangeFrom); - cmsDataObject.setExcludeByteRangeTo(excludeByteRangeTo); - - return cmsDataObject; - } - - public CMSContent createCMSContent(InputStream binaryContent) { - CMSContentExplicitImpl cmsContent = new CMSContentExplicitImpl(); - - cmsContent.setBinaryContent(binaryContent); - return cmsContent; - } - - public CMSContent createCMSContent(String referenceURI) { - CMSContentReferenceImpl cmsContent = new CMSContentReferenceImpl(); - - cmsContent.setReference(referenceURI); - return cmsContent; - } - - public CMSDataObject createCMSDataObject(MetaInfo metaInfo, String referenceURI) { - CMSDataObjectImpl cmsDataObject = new CMSDataObjectImpl(); - CMSContentReferenceImpl cmsContent = new CMSContentReferenceImpl(); - cmsDataObject.setMetaInfo(metaInfo); - cmsContent.setReference(referenceURI); - return cmsDataObject; - } - - public VerifyCMSSignatureResponse createVerifyCMSSignatureResponse(List responseElements) { - VerifyCMSSinatureResponseImpl verifyCMSSignatureResponse = new VerifyCMSSinatureResponseImpl(); - verifyCMSSignatureResponse.setResponseElements(responseElements); - return verifyCMSSignatureResponse; - } - - public VerifyCMSSignatureResponseElement createVerifyCMSSignatureResponseElement(SignerInfo signerInfo, - CheckResult signatureCheck, CheckResult certificateCheck, List adesResult, - ExtendedCertificateCheckResult extendedCertificateCheckResult, String usedAlgorithm, Boolean coversFullDocument, - int[] byteRangeOfSignature) { - VerifyCMSSignatureResponseElementImpl verifyCMSSignatureResponseElement = new VerifyCMSSignatureResponseElementImpl(); - verifyCMSSignatureResponseElement.setSignerInfo(signerInfo); - verifyCMSSignatureResponseElement.setSignatureCheck(signatureCheck); - verifyCMSSignatureResponseElement.setCertificateCheck(certificateCheck); - verifyCMSSignatureResponseElement.setAdESFormResults(adesResult); - verifyCMSSignatureResponseElement.setExtendedCertificateCheck(extendedCertificateCheckResult); - verifyCMSSignatureResponseElement.setSignatureAlgorithm(usedAlgorithm); - verifyCMSSignatureResponseElement.setCoversFullDocument(coversFullDocument); - verifyCMSSignatureResponseElement.setByteRangeOfSignature(byteRangeOfSignature); - return verifyCMSSignatureResponseElement; - } - - public VerifyXMLSignatureRequest createVerifyXMLSignatureRequest(Date dateTime, - VerifySignatureInfo verifySignatureInfo, List supplementProfiles, - SignatureManifestCheckParams signatureManifestParams, boolean returnHashInputData, String trustProfileID) { - return this.createVerifyXMLSignatureRequest(dateTime, verifySignatureInfo, supplementProfiles, - signatureManifestParams, returnHashInputData, trustProfileID, false); - } - - public VerifySignatureInfo createVerifySignatureInfo(Content verifySignatureEnvironment, - VerifySignatureLocation verifySignatureLocation) { - VerifySignatureInfoImpl verifySignatureInfo = new VerifySignatureInfoImpl(); - verifySignatureInfo.setVerifySignatureEnvironment(verifySignatureEnvironment); - verifySignatureInfo.setVerifySignatureLocation(verifySignatureLocation); - return verifySignatureInfo; - } - - public VerifySignatureLocation createVerifySignatureLocation(String xPathExpression, Map namespaceDeclarations) { - VerifySignatureLocationImpl verifySignatureLocation = new VerifySignatureLocationImpl(); - verifySignatureLocation.setXPathExpression(xPathExpression); - verifySignatureLocation.setNamespaceDeclarations(namespaceDeclarations); - return verifySignatureLocation; - } - - public SupplementProfile createSupplementProfile(String profileID) { - SupplementProfileIDImpl supplementProfileID = new SupplementProfileIDImpl(); - supplementProfileID.setSupplementProfileID(profileID); - return supplementProfileID; - } - - public SupplementProfile createSupplementProfile(XMLDataObjectAssociation supplementProfile) { - SupplementProfileExplicitImpl supplementProfileExplicit = new SupplementProfileExplicitImpl(); - supplementProfileExplicit.setSupplementProfile(supplementProfile); - return supplementProfileExplicit; - } - - public SignatureManifestCheckParams createSignatureManifestCheckParams(List referenceInfos, - boolean returnReferenceInputData) { - SignatureManifestCheckParamsImpl signatureManifestCheckParams = new SignatureManifestCheckParamsImpl(); - signatureManifestCheckParams.setReferenceInfos(referenceInfos); - signatureManifestCheckParams.setReturnReferenceInputData(returnReferenceInputData); - return signatureManifestCheckParams; - } - - public ReferenceInfo createReferenceInfo(List verifyTransformsInfoProfiles) { - ReferenceInfoImpl referenceInfo = new ReferenceInfoImpl(); - referenceInfo.setVerifyTransformsInfoProfiles(verifyTransformsInfoProfiles); - return referenceInfo; - } - - public VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(List transforms, List transformParameters) { - VerifyTransformsInfoProfileExplicitImpl verifyTransformsInfoProfile = new VerifyTransformsInfoProfileExplicitImpl(); - - verifyTransformsInfoProfile.setTransforms(transforms); - verifyTransformsInfoProfile.setTransformParameters(transformParameters); - - return verifyTransformsInfoProfile; - } - - public VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(String profileID) { - VerifyTransformsInfoProfileIDImpl verifyTransformsInfoProfile = new VerifyTransformsInfoProfileIDImpl(); - verifyTransformsInfoProfile.setVerifyTransformsInfoProfileID(profileID); - return verifyTransformsInfoProfile; - } - - public TransformParameter createTransformParameter(String URI, String digestMethod, byte[] digestValue) { - TransformPatameterHashImpl transformParameter = new TransformPatameterHashImpl(); - transformParameter.setURI(URI); - transformParameter.setDigestMethod(digestMethod); - transformParameter.setDigestValue(digestValue); - return transformParameter; - } - - public TransformParameter createTransformParameter(String URI, InputStream binaryData) { - TransformParameterBinaryImpl transformParameter = new TransformParameterBinaryImpl(); - transformParameter.setURI(URI); - transformParameter.setBinaryContent(binaryData); - return transformParameter; - } - - public TransformParameter createTransformParameter(String URI) { - TransformParameterURIImpl transformParameter = new TransformParameterURIImpl(); - transformParameter.setURI(URI); - return transformParameter; - } - - public VerifyXMLSignatureResponse createVerifyXMLSignatureResponse(SignerInfo signerInfo, List hashInputDatas, - List referenceInputDatas, ReferencesCheckResult signatureCheck, - ReferencesCheckResult signatureManifestCheck, List xmlDsigManifestChecks, CheckResult certificateCheck, - List adesFormResults, ExtendedCertificateCheckResult extCheckResult, String signatureAlgorithm) { - VerifyXMLSignatureResponseImpl verifyXMLSignatureResponse = new VerifyXMLSignatureResponseImpl(); - verifyXMLSignatureResponse.setSignerInfo(signerInfo); - verifyXMLSignatureResponse.setHashInputDatas(hashInputDatas); - verifyXMLSignatureResponse.setReferenceInputDatas(referenceInputDatas); - verifyXMLSignatureResponse.setSignatureAlgorithm(signatureAlgorithm); - verifyXMLSignatureResponse.setSignatureCheck(signatureCheck); - verifyXMLSignatureResponse.setSignatureManifestCheck(signatureManifestCheck); - verifyXMLSignatureResponse.setXMLDsigManifestChecks(xmlDsigManifestChecks); - verifyXMLSignatureResponse.setCertificateCheck(certificateCheck); - verifyXMLSignatureResponse.setAdESFormResults(adesFormResults); - verifyXMLSignatureResponse.setExtendedCertificateCheck(extCheckResult); - return verifyXMLSignatureResponse; - } - - public ReferencesCheckResult createReferencesCheckResult(int code, ReferencesCheckResultInfo info) { - ReferencesCheckResultImpl referencesCheckResult = new ReferencesCheckResultImpl(); - referencesCheckResult.setCode(code); - referencesCheckResult.setInfo(info); - return referencesCheckResult; - } - - public ReferencesCheckResultInfo createReferencesCheckResultInfo(NodeList anyOtherInfo, int[] failedReferences) { - ReferencesCheckResultInfoImpl referencesCheckResultInfo = new ReferencesCheckResultInfoImpl(); - referencesCheckResultInfo.setAnyOtherInfo(anyOtherInfo); - referencesCheckResultInfo.setFailedReferences(failedReferences); - return referencesCheckResultInfo; - } - - public ManifestRefsCheckResult createManifestRefsCheckResult(int code, ManifestRefsCheckResultInfo info) { - ManifestRefsCheckResultImpl manifestRefsCheckResult = new ManifestRefsCheckResultImpl(); - manifestRefsCheckResult.setCode(code); - manifestRefsCheckResult.setInfo(info); - return manifestRefsCheckResult; - } - - public ManifestRefsCheckResultInfo createManifestRefsCheckResultInfo(NodeList anyOtherInfo, int[] failedReferences, - int referringSigReference) { - ManifestRefsCheckResultInfoImpl manifestRefsCheckResultInfo = new ManifestRefsCheckResultInfoImpl(); - manifestRefsCheckResultInfo.setAnyOtherInfo(anyOtherInfo); - manifestRefsCheckResultInfo.setReferringSignatureReference(referringSigReference); - manifestRefsCheckResultInfo.setFailedReferences(failedReferences); - return manifestRefsCheckResultInfo; - } - - public Content createContent(InputStream binaryData, String referenceURI) { - ContentBinaryImpl content = new ContentBinaryImpl(); - content.setBinaryContent(binaryData); - content.setReference(referenceURI); - return content; - } - - public Content createContent(String locationReferenceURI, String referenceURI) { - ContentLocRefImpl content = new ContentLocRefImpl(); - content.setLocationReferenceURI(locationReferenceURI); - content.setReference(referenceURI); - return content; - } - - public Content createContent(String referenceURI) { - ContentReferenceImpl content = new ContentReferenceImpl(); - content.setReference(referenceURI); - return content; - } - - public Content createContent(NodeList xmlData, String referenceURI) { - ContentXMLImpl content = new ContentXMLImpl(); - content.setXMLContent(xmlData); - content.setReference(referenceURI); - return content; - } - - public XMLDataObjectAssociation createXMLDataObjectAssociation(MetaInfo metaInfo, Content xmlContent) { - XMLDataObjectAssociationImpl xmlDataObjectAssociation = new XMLDataObjectAssociationImpl(); - xmlDataObjectAssociation.setMetaInfo(metaInfo); - xmlDataObjectAssociation.setContent(xmlContent); - return xmlDataObjectAssociation; - } - - public MetaInfo createMetaInfo(String mimeType, String description, NodeList otherInfo, String type) { - MetaInfoImpl metaInfo = new MetaInfoImpl(); - metaInfo.setMimeType(mimeType); - metaInfo.setDescription(description); - metaInfo.setAnyElements(otherInfo); - metaInfo.setType(type); - return metaInfo; - } - - public Transform createCanonicalizationTransform(String algorithmURI) { - CanonicalizationTransformImpl transform = new CanonicalizationTransformImpl(algorithmURI); - return transform; - } - - public Transform createExclusiveCanonicalizationTransform(String algorithmURI, List inclusiveNamespacePrefixes) { - ExclusiveCanonicalizationTransformImpl transform = new ExclusiveCanonicalizationTransformImpl(algorithmURI); - transform.setInclusiveNamespacePrefixes(inclusiveNamespacePrefixes); - return transform; - } - - public Transform createBase64Transform() { - Base64TransformImpl transform = new Base64TransformImpl(); - return transform; - } - - public Transform createEnvelopedSignatureTransform() { - EnvelopedSignatureTransformImpl transform = new EnvelopedSignatureTransformImpl(); - return transform; - } - - public Transform createXSLTTransform(Element styleSheet) { - XSLTransformImpl transform = new XSLTransformImpl(); - transform.setStylesheet(styleSheet); - return transform; - } - - public Transform createXPathTransform(String xPathExpression, Map namespaceDeclarations) { - XPathTransformImpl transform = new XPathTransformImpl(); - transform.setXPathExpression(xPathExpression); - transform.setNamespaceDelcarations(namespaceDeclarations); - return transform; - } - - public Transform createXPathFilter2Transform(List xPathFilters) { - XPathFilter2TransformImpl transform = new XPathFilter2TransformImpl(); - transform.setFilters(xPathFilters); - return transform; - } - - public XPathFilter createXPathFilter(String filterType, String xPathExpression, Map namespaceDeclarations) { - XPathFilterImpl xPathFilter = new XPathFilterImpl(); - xPathFilter.setFilterType(filterType); - xPathFilter.setXPathExpression(xPathExpression); - xPathFilter.setNamespaceDelcarations(namespaceDeclarations); - return xPathFilter; - } - - public CheckResult createCheckResult(int code, NodeList info) { - CheckResultImpl checkResult = new CheckResultImpl(); - checkResult.setCode(code); - checkResult.setInfo(info); - return checkResult; - } - - public SignerInfo createSignerInfo(X509Certificate signerCertificate, boolean qualifiedCertificate, - boolean qcSourceTSL, boolean publicAuthority, String publicAuthorityID, boolean sscd, boolean sscdSourceTSL, - String issuerCountryCode, Date signingTime, TslInfos tslInfos) { - SignerInfoImpl signerInfo = new SignerInfoImpl(); - signerInfo.setSignerCertificate(signerCertificate); - signerInfo.setQualifiedCertificate(qualifiedCertificate); - signerInfo.setQCSourceTSL(qcSourceTSL); - signerInfo.setPublicAuthority(publicAuthority); - signerInfo.setPublicAuhtorityID(publicAuthorityID); - signerInfo.setSSCD(sscd); - signerInfo.setSSCDSourceTSL(sscdSourceTSL); - signerInfo.setIssuerCountryCode(issuerCountryCode); - signerInfo.setSigningTime(signingTime); - signerInfo.setTslInfos(tslInfos); - return signerInfo; - } - - public X509IssuerSerial createX509IssuerSerial(String issuerName, BigInteger serialNumber) { - X509IssuerSerialImpl x509IssuerSerial = new X509IssuerSerialImpl(); - x509IssuerSerial.setX509IssuerName(issuerName); - x509IssuerSerial.setX509SerialNumber(serialNumber); - return x509IssuerSerial; - } - - @Override - public VerifyXMLSignatureRequest createVerifyXMLSignatureRequest(Date dateTime, - VerifySignatureInfo verifySignatureInfo, List supplementProfiles, - SignatureManifestCheckParams signatureManifestParams, boolean returnHashInputData, String trustProfileID, - boolean extendedValidation) { - VerifyXMLSignatureRequestImpl verifyXMLSignatureRequest = new VerifyXMLSignatureRequestImpl(); - verifyXMLSignatureRequest.setDateTime(dateTime); - verifyXMLSignatureRequest.setSignatureInfo(verifySignatureInfo); - verifyXMLSignatureRequest.setSupplementProfiles(supplementProfiles); - verifyXMLSignatureRequest.setSignatureManifestCheckParams(signatureManifestParams); - verifyXMLSignatureRequest.setReturnHashInputData(returnHashInputData); - verifyXMLSignatureRequest.setTrustProfileId(trustProfileID); - verifyXMLSignatureRequest.setExtendedValidation(extendedValidation); - return verifyXMLSignatureRequest; - } + @Override + public CreateXMLSignatureRequest createCreateXMLSignatureRequest(String keyIdentifier, + List singleSignatureInfos) { + final CreateXMLSignatureRequestImpl createXMLSignatureRequest = new CreateXMLSignatureRequestImpl(); + createXMLSignatureRequest.setKeyIdentifier(keyIdentifier); + createXMLSignatureRequest.setSingleSignatureInfos(singleSignatureInfos); + return createXMLSignatureRequest; + } + + @Override + public CreateCMSSignatureRequest createCreateCMSSignatureRequest(String keyIdentifier, + List singleSignatureInfos) { + final CreateCMSSignatureRequestImpl createCMSSignatureRequest = new CreateCMSSignatureRequestImpl(); + createCMSSignatureRequest.setKeyIdentifier(keyIdentifier); + createCMSSignatureRequest.setSingleSignatureInfos(singleSignatureInfos); + return createCMSSignatureRequest; + + } + + @Override + public CreateCMSSignatureResponse createCreateCMSSignatureResponse(List responseElements) { + final CreateCMSSignatureResponseImpl createCMSSignatureResponse = new CreateCMSSignatureResponseImpl(); + createCMSSignatureResponse.setResponseElements(responseElements); + return createCMSSignatureResponse; + } + + @Override + public CMSSignatureResponse createCMSSignatureResponse(String base64value) { + final CMSSignatureResponseImpl cmsSignatureResponse = new CMSSignatureResponseImpl(); + cmsSignatureResponse.setCMSSignature(base64value); + + return cmsSignatureResponse; + } + + @Override + public SingleSignatureInfo createSingleSignatureInfo(List dataObjectInfos, + CreateSignatureInfo createSignatureInfo, + boolean securityLayerConform) { + final SingleSignatureInfoImpl singleSignatureInfo = new SingleSignatureInfoImpl(); + singleSignatureInfo.setDataObjectInfos(dataObjectInfos); + singleSignatureInfo.setCreateSignatureInfo(createSignatureInfo); + singleSignatureInfo.setSecurityLayerConform(securityLayerConform); + return singleSignatureInfo; + } + + @Override + public at.gv.egovernment.moa.spss.api.cmssign.SingleSignatureInfo createSingleSignatureInfoCMS( + at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo dataObjectInfo, boolean securityLayerConform, + boolean isPAdESConform) { + final SingleSignatureInfoCMSImpl singleSignatureInfo = new SingleSignatureInfoCMSImpl(); + singleSignatureInfo.setDataObjectInfo(dataObjectInfo); + singleSignatureInfo.setSecurityLayerConform(securityLayerConform); + singleSignatureInfo.setPAdESConform(isPAdESConform); + return singleSignatureInfo; + } + + @Override + public DataObjectInfo createDataObjectInfo(String structure, boolean childOfManifest, Content dataObject, + CreateTransformsInfoProfile createTransformsInfoProfile) { + final DataObjectInfoImpl dataObjectInfo = new DataObjectInfoImpl(); + dataObjectInfo.setStructure(structure); + dataObjectInfo.setChildOfManifest(childOfManifest); + dataObjectInfo.setDataObject(dataObject); + dataObjectInfo.setCreateTransformsInfoProfile(createTransformsInfoProfile); + return dataObjectInfo; + } + + @Override + public at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo createDataObjectInfo(String structure, + CMSDataObject dataObject) { + final DataObjectInfoCMSImpl dataObjectInfo = new DataObjectInfoCMSImpl(); + dataObjectInfo.setStructure(structure); + dataObjectInfo.setDataObject(dataObject); + return dataObjectInfo; + } + + @Override + public CreateTransformsInfoProfile createCreateTransformsInfoProfile(String profileID) { + + final CreateTransformsInfoProfileIDImpl createTransformsInfoProfile = + new CreateTransformsInfoProfileIDImpl(); + createTransformsInfoProfile.setCreateTransformsInfoProfileID(profileID); + return createTransformsInfoProfile; + } + + @Override + public CreateTransformsInfoProfile createCreateTransformsInfoProfile(CreateTransformsInfo transformsInfo, + List supplements) { + final CreateTransformsInfoProfileExplicitImpl createTransformsInfoProfile = + new CreateTransformsInfoProfileExplicitImpl(); + createTransformsInfoProfile.setCreateTransformsInfo(transformsInfo); + createTransformsInfoProfile.setSupplements(supplements); + return createTransformsInfoProfile; + } + + @Override + public CreateTransformsInfo createCreateTransformsInfo(List transforms, MetaInfo finalDataMetaInfo) { + final CreateTransformsInfoImpl createTransformsInfo = new CreateTransformsInfoImpl(); + + createTransformsInfo.setTransforms(transforms); + createTransformsInfo.setFinalDataMetaInfo(finalDataMetaInfo); + return createTransformsInfo; + } + + @Override + public CreateSignatureInfo createCreateSignatureInfo(Content createSignatureEnvironment, + CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile) { + final CreateSignatureInfoImpl createSignatureInfo = new CreateSignatureInfoImpl(); + createSignatureInfo.setCreateSignatureEnvironment(createSignatureEnvironment); + createSignatureInfo.setCreateSignatureEnvironmentProfile(createSignatureEnvironmentProfile); + return createSignatureInfo; + } + + @Override + public CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile( + CreateSignatureLocation createSignatureLocation, List supplements) { + final CreateSignatureEnvironmentProfileExplicitImpl createSignatureEnvironmentProfile = + new CreateSignatureEnvironmentProfileExplicitImpl(); + createSignatureEnvironmentProfile.setCreateSignatureLocation(createSignatureLocation); + createSignatureEnvironmentProfile.setSupplements(supplements); + return createSignatureEnvironmentProfile; + } + + @Override + public CreateSignatureLocation createCreateSignatureLocation(String signatureLocationXPath, + int signatureLocationIndex, Map namespaceDeclarations) { + final CreateSignatureLocationImpl createSignatureLocation = new CreateSignatureLocationImpl(); + createSignatureLocation.setIndex(signatureLocationIndex); + createSignatureLocation.setNamespaceDeclarations(namespaceDeclarations); + createSignatureLocation.setXPathExpression(signatureLocationXPath); + return createSignatureLocation; + } + + @Override + public CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile(String profileID) { + final CreateSignatureEnvironmentProfileIDImpl createSignatureEnvironmentProfile = + new CreateSignatureEnvironmentProfileIDImpl(); + createSignatureEnvironmentProfile.setCreateSignatureEnvironmentProfileID(profileID); + return createSignatureEnvironmentProfile; + } + + @Override + public CreateXMLSignatureResponse createCreateXMLSignatureResponse(List responseElements) { + final CreateXMLSignatureResponseImpl createXMLSignatureResponse = new CreateXMLSignatureResponseImpl(); + createXMLSignatureResponse.setResponseElements(responseElements); + return createXMLSignatureResponse; + } + + @Override + public SignatureEnvironmentResponse createSignatureEnvironmentResponse(Element signatureEnvironment) { + final SignatureEnvironmentResponseImpl signatureEnvironmentResponse = + new SignatureEnvironmentResponseImpl(); + signatureEnvironmentResponse.setSignatureEnvironment(signatureEnvironment); + return signatureEnvironmentResponse; + } + + @Override + public ErrorResponse createErrorResponse(int code, String info) { + final ErrorResponseImpl errorResponse = new ErrorResponseImpl(); + errorResponse.setErrorCode(code); + errorResponse.setInfo(info); + return errorResponse; + } + + @Override + public VerifyCMSSignatureRequest createVerifyCMSSignatureRequest(int[] signatories, Date dateTime, + InputStream cmsSignature, CMSDataObject dataObject, String trustProfileID, boolean pdf) { + return this.createVerifyCMSSignatureRequest(signatories, dateTime, cmsSignature, dataObject, + trustProfileID, pdf, false); + } + + @Override + public VerifyCMSSignatureRequest createVerifyCMSSignatureRequest(int[] signatories, Date dateTime, + InputStream cmsSignature, CMSDataObject dataObject, String trustProfileID, boolean pdf, + boolean extended) { + final VerifyCMSSignatureRequestImpl verifyCMSSignatureRequest = new VerifyCMSSignatureRequestImpl(); + verifyCMSSignatureRequest.setDateTime(dateTime); + verifyCMSSignatureRequest.setCMSSignature(cmsSignature); + verifyCMSSignatureRequest.setDataObject(dataObject); + verifyCMSSignatureRequest.setTrustProfileId(trustProfileID); + verifyCMSSignatureRequest.setSignatories(signatories); + verifyCMSSignatureRequest.setPDF(pdf); + verifyCMSSignatureRequest.setExtended(extended); + return verifyCMSSignatureRequest; + } + + @Override + public CMSDataObject createCMSDataObject(MetaInfo metaInfo, CMSContent content, + BigDecimal excludeByteRangeFrom, + BigDecimal excludeByteRangeTo) { + + final CMSDataObjectImpl cmsDataObject = new CMSDataObjectImpl(); + cmsDataObject.setMetaInfo(metaInfo); + cmsDataObject.setContent(content); + cmsDataObject.setExcludeByteRangeFrom(excludeByteRangeFrom); + cmsDataObject.setExcludeByteRangeTo(excludeByteRangeTo); + + return cmsDataObject; + } + + @Override + public CMSContent createCMSContent(InputStream binaryContent) { + final CMSContentExplicitImpl cmsContent = new CMSContentExplicitImpl(); + + cmsContent.setBinaryContent(binaryContent); + return cmsContent; + } + + @Override + public CMSContent createCMSContent(String referenceURI) { + final CMSContentReferenceImpl cmsContent = new CMSContentReferenceImpl(); + + cmsContent.setReference(referenceURI); + return cmsContent; + } + + public CMSDataObject createCMSDataObject(MetaInfo metaInfo, String referenceURI) { + final CMSDataObjectImpl cmsDataObject = new CMSDataObjectImpl(); + final CMSContentReferenceImpl cmsContent = new CMSContentReferenceImpl(); + cmsDataObject.setMetaInfo(metaInfo); + cmsContent.setReference(referenceURI); + return cmsDataObject; + } + + @Override + public VerifyCMSSignatureResponse createVerifyCMSSignatureResponse(List responseElements) { + final VerifyCMSSinatureResponseImpl verifyCMSSignatureResponse = new VerifyCMSSinatureResponseImpl(); + verifyCMSSignatureResponse.setResponseElements(responseElements); + return verifyCMSSignatureResponse; + } + + @Override + public VerifyCMSSignatureResponseElement createVerifyCMSSignatureResponseElement(SignerInfo signerInfo, + CheckResult signatureCheck, CheckResult certificateCheck, List adesResult, + ExtendedCertificateCheckResult extendedCertificateCheckResult, String usedAlgorithm, + Boolean coversFullDocument, + int[] byteRangeOfSignature) { + final VerifyCMSSignatureResponseElementImpl verifyCMSSignatureResponseElement = + new VerifyCMSSignatureResponseElementImpl(); + verifyCMSSignatureResponseElement.setSignerInfo(signerInfo); + verifyCMSSignatureResponseElement.setSignatureCheck(signatureCheck); + verifyCMSSignatureResponseElement.setCertificateCheck(certificateCheck); + verifyCMSSignatureResponseElement.setAdESFormResults(adesResult); + verifyCMSSignatureResponseElement.setExtendedCertificateCheck(extendedCertificateCheckResult); + verifyCMSSignatureResponseElement.setSignatureAlgorithm(usedAlgorithm); + verifyCMSSignatureResponseElement.setCoversFullDocument(coversFullDocument); + verifyCMSSignatureResponseElement.setByteRangeOfSignature(byteRangeOfSignature); + return verifyCMSSignatureResponseElement; + } + + @Override + public VerifyXMLSignatureRequest createVerifyXMLSignatureRequest(Date dateTime, + VerifySignatureInfo verifySignatureInfo, List supplementProfiles, + SignatureManifestCheckParams signatureManifestParams, boolean returnHashInputData, + String trustProfileID) { + return this.createVerifyXMLSignatureRequest(dateTime, verifySignatureInfo, supplementProfiles, + signatureManifestParams, returnHashInputData, trustProfileID, false); + } + + @Override + public VerifySignatureInfo createVerifySignatureInfo(Content verifySignatureEnvironment, + VerifySignatureLocation verifySignatureLocation) { + final VerifySignatureInfoImpl verifySignatureInfo = new VerifySignatureInfoImpl(); + verifySignatureInfo.setVerifySignatureEnvironment(verifySignatureEnvironment); + verifySignatureInfo.setVerifySignatureLocation(verifySignatureLocation); + return verifySignatureInfo; + } + + @Override + public VerifySignatureLocation createVerifySignatureLocation(String xPathExpression, + Map namespaceDeclarations) { + final VerifySignatureLocationImpl verifySignatureLocation = new VerifySignatureLocationImpl(); + verifySignatureLocation.setXPathExpression(xPathExpression); + verifySignatureLocation.setNamespaceDeclarations(namespaceDeclarations); + return verifySignatureLocation; + } + + @Override + public SupplementProfile createSupplementProfile(String profileID) { + final SupplementProfileIDImpl supplementProfileID = new SupplementProfileIDImpl(); + supplementProfileID.setSupplementProfileID(profileID); + return supplementProfileID; + } + + @Override + public SupplementProfile createSupplementProfile(XMLDataObjectAssociation supplementProfile) { + final SupplementProfileExplicitImpl supplementProfileExplicit = new SupplementProfileExplicitImpl(); + supplementProfileExplicit.setSupplementProfile(supplementProfile); + return supplementProfileExplicit; + } + + @Override + public SignatureManifestCheckParams createSignatureManifestCheckParams(List referenceInfos, + boolean returnReferenceInputData) { + final SignatureManifestCheckParamsImpl signatureManifestCheckParams = + new SignatureManifestCheckParamsImpl(); + signatureManifestCheckParams.setReferenceInfos(referenceInfos); + signatureManifestCheckParams.setReturnReferenceInputData(returnReferenceInputData); + return signatureManifestCheckParams; + } + + @Override + public ReferenceInfo createReferenceInfo(List verifyTransformsInfoProfiles) { + final ReferenceInfoImpl referenceInfo = new ReferenceInfoImpl(); + referenceInfo.setVerifyTransformsInfoProfiles(verifyTransformsInfoProfiles); + return referenceInfo; + } + + @Override + public VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(List transforms, + List transformParameters) { + final VerifyTransformsInfoProfileExplicitImpl verifyTransformsInfoProfile = + new VerifyTransformsInfoProfileExplicitImpl(); + + verifyTransformsInfoProfile.setTransforms(transforms); + verifyTransformsInfoProfile.setTransformParameters(transformParameters); + + return verifyTransformsInfoProfile; + } + + @Override + public VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(String profileID) { + final VerifyTransformsInfoProfileIDImpl verifyTransformsInfoProfile = + new VerifyTransformsInfoProfileIDImpl(); + verifyTransformsInfoProfile.setVerifyTransformsInfoProfileID(profileID); + return verifyTransformsInfoProfile; + } + + @Override + public TransformParameter createTransformParameter(String URI, String digestMethod, byte[] digestValue) { + final TransformPatameterHashImpl transformParameter = new TransformPatameterHashImpl(); + transformParameter.setURI(URI); + transformParameter.setDigestMethod(digestMethod); + transformParameter.setDigestValue(digestValue); + return transformParameter; + } + + @Override + public TransformParameter createTransformParameter(String URI, InputStream binaryData) { + final TransformParameterBinaryImpl transformParameter = new TransformParameterBinaryImpl(); + transformParameter.setURI(URI); + transformParameter.setBinaryContent(binaryData); + return transformParameter; + } + + @Override + public TransformParameter createTransformParameter(String URI) { + final TransformParameterURIImpl transformParameter = new TransformParameterURIImpl(); + transformParameter.setURI(URI); + return transformParameter; + } + + @Override + public VerifyXMLSignatureResponse createVerifyXMLSignatureResponse(SignerInfo signerInfo, + List hashInputDatas, + List referenceInputDatas, ReferencesCheckResult signatureCheck, + ReferencesCheckResult signatureManifestCheck, List xmlDsigManifestChecks, CheckResult certificateCheck, + List adesFormResults, ExtendedCertificateCheckResult extCheckResult, String signatureAlgorithm) { + final VerifyXMLSignatureResponseImpl verifyXMLSignatureResponse = new VerifyXMLSignatureResponseImpl(); + verifyXMLSignatureResponse.setSignerInfo(signerInfo); + verifyXMLSignatureResponse.setHashInputDatas(hashInputDatas); + verifyXMLSignatureResponse.setReferenceInputDatas(referenceInputDatas); + verifyXMLSignatureResponse.setSignatureAlgorithm(signatureAlgorithm); + verifyXMLSignatureResponse.setSignatureCheck(signatureCheck); + verifyXMLSignatureResponse.setSignatureManifestCheck(signatureManifestCheck); + verifyXMLSignatureResponse.setXMLDsigManifestChecks(xmlDsigManifestChecks); + verifyXMLSignatureResponse.setCertificateCheck(certificateCheck); + verifyXMLSignatureResponse.setAdESFormResults(adesFormResults); + verifyXMLSignatureResponse.setExtendedCertificateCheck(extCheckResult); + return verifyXMLSignatureResponse; + } + + @Override + public ReferencesCheckResult createReferencesCheckResult(int code, ReferencesCheckResultInfo info) { + final ReferencesCheckResultImpl referencesCheckResult = new ReferencesCheckResultImpl(); + referencesCheckResult.setCode(code); + referencesCheckResult.setInfo(info); + return referencesCheckResult; + } + + @Override + public ReferencesCheckResultInfo createReferencesCheckResultInfo(NodeList anyOtherInfo, + int[] failedReferences) { + final ReferencesCheckResultInfoImpl referencesCheckResultInfo = new ReferencesCheckResultInfoImpl(); + referencesCheckResultInfo.setAnyOtherInfo(anyOtherInfo); + referencesCheckResultInfo.setFailedReferences(failedReferences); + return referencesCheckResultInfo; + } + + @Override + public ManifestRefsCheckResult createManifestRefsCheckResult(int code, ManifestRefsCheckResultInfo info) { + final ManifestRefsCheckResultImpl manifestRefsCheckResult = new ManifestRefsCheckResultImpl(); + manifestRefsCheckResult.setCode(code); + manifestRefsCheckResult.setInfo(info); + return manifestRefsCheckResult; + } + + @Override + public ManifestRefsCheckResultInfo createManifestRefsCheckResultInfo(NodeList anyOtherInfo, + int[] failedReferences, + int referringSigReference) { + final ManifestRefsCheckResultInfoImpl manifestRefsCheckResultInfo = new ManifestRefsCheckResultInfoImpl(); + manifestRefsCheckResultInfo.setAnyOtherInfo(anyOtherInfo); + manifestRefsCheckResultInfo.setReferringSignatureReference(referringSigReference); + manifestRefsCheckResultInfo.setFailedReferences(failedReferences); + return manifestRefsCheckResultInfo; + } + + @Override + public Content createContent(InputStream binaryData, String referenceURI) { + final ContentBinaryImpl content = new ContentBinaryImpl(); + content.setBinaryContent(binaryData); + content.setReference(referenceURI); + return content; + } + + @Override + public Content createContent(String locationReferenceURI, String referenceURI) { + final ContentLocRefImpl content = new ContentLocRefImpl(); + content.setLocationReferenceURI(locationReferenceURI); + content.setReference(referenceURI); + return content; + } + + @Override + public Content createContent(String referenceURI) { + final ContentReferenceImpl content = new ContentReferenceImpl(); + content.setReference(referenceURI); + return content; + } + + @Override + public Content createContent(NodeList xmlData, String referenceURI) { + final ContentXMLImpl content = new ContentXMLImpl(); + content.setXMLContent(xmlData); + content.setReference(referenceURI); + return content; + } + + @Override + public XMLDataObjectAssociation createXMLDataObjectAssociation(MetaInfo metaInfo, Content xmlContent) { + final XMLDataObjectAssociationImpl xmlDataObjectAssociation = new XMLDataObjectAssociationImpl(); + xmlDataObjectAssociation.setMetaInfo(metaInfo); + xmlDataObjectAssociation.setContent(xmlContent); + return xmlDataObjectAssociation; + } + + @Override + public MetaInfo createMetaInfo(String mimeType, String description, NodeList otherInfo, String type) { + final MetaInfoImpl metaInfo = new MetaInfoImpl(); + metaInfo.setMimeType(mimeType); + metaInfo.setDescription(description); + metaInfo.setAnyElements(otherInfo); + metaInfo.setType(type); + return metaInfo; + } + + @Override + public Transform createCanonicalizationTransform(String algorithmURI) { + final CanonicalizationTransformImpl transform = new CanonicalizationTransformImpl(algorithmURI); + return transform; + } + + @Override + public Transform createExclusiveCanonicalizationTransform(String algorithmURI, + List inclusiveNamespacePrefixes) { + final ExclusiveCanonicalizationTransformImpl transform = new ExclusiveCanonicalizationTransformImpl( + algorithmURI); + transform.setInclusiveNamespacePrefixes(inclusiveNamespacePrefixes); + return transform; + } + + @Override + public Transform createBase64Transform() { + final Base64TransformImpl transform = new Base64TransformImpl(); + return transform; + } + + @Override + public Transform createEnvelopedSignatureTransform() { + final EnvelopedSignatureTransformImpl transform = new EnvelopedSignatureTransformImpl(); + return transform; + } + + @Override + public Transform createXSLTTransform(Element styleSheet) { + final XSLTransformImpl transform = new XSLTransformImpl(); + transform.setStylesheet(styleSheet); + return transform; + } + + @Override + public Transform createXPathTransform(String xPathExpression, Map namespaceDeclarations) { + final XPathTransformImpl transform = new XPathTransformImpl(); + transform.setXPathExpression(xPathExpression); + transform.setNamespaceDelcarations(namespaceDeclarations); + return transform; + } + + @Override + public Transform createXPathFilter2Transform(List xPathFilters) { + final XPathFilter2TransformImpl transform = new XPathFilter2TransformImpl(); + transform.setFilters(xPathFilters); + return transform; + } + + @Override + public XPathFilter createXPathFilter(String filterType, String xPathExpression, Map namespaceDeclarations) { + final XPathFilterImpl xPathFilter = new XPathFilterImpl(); + xPathFilter.setFilterType(filterType); + xPathFilter.setXPathExpression(xPathExpression); + xPathFilter.setNamespaceDelcarations(namespaceDeclarations); + return xPathFilter; + } + + @Override + public CheckResult createCheckResult(int code, NodeList info) { + final CheckResultImpl checkResult = new CheckResultImpl(); + checkResult.setCode(code); + checkResult.setInfo(info); + return checkResult; + } + + @Override + public SignerInfo createSignerInfo(X509Certificate signerCertificate, boolean qualifiedCertificate, + boolean qcSourceTSL, boolean publicAuthority, String publicAuthorityID, boolean sscd, + boolean sscdSourceTSL, + String issuerCountryCode, Date signingTime, TslInfos tslInfos) { + final SignerInfoImpl signerInfo = new SignerInfoImpl(); + signerInfo.setSignerCertificate(signerCertificate); + signerInfo.setQualifiedCertificate(qualifiedCertificate); + signerInfo.setQCSourceTSL(qcSourceTSL); + signerInfo.setPublicAuthority(publicAuthority); + signerInfo.setPublicAuhtorityID(publicAuthorityID); + signerInfo.setSSCD(sscd); + signerInfo.setSSCDSourceTSL(sscdSourceTSL); + signerInfo.setIssuerCountryCode(issuerCountryCode); + signerInfo.setSigningTime(signingTime); + signerInfo.setTslInfos(tslInfos); + return signerInfo; + } + + @Override + public X509IssuerSerial createX509IssuerSerial(String issuerName, BigInteger serialNumber) { + final X509IssuerSerialImpl x509IssuerSerial = new X509IssuerSerialImpl(); + x509IssuerSerial.setX509IssuerName(issuerName); + x509IssuerSerial.setX509SerialNumber(serialNumber); + return x509IssuerSerial; + } + + @Override + public VerifyXMLSignatureRequest createVerifyXMLSignatureRequest(Date dateTime, + VerifySignatureInfo verifySignatureInfo, List supplementProfiles, + SignatureManifestCheckParams signatureManifestParams, boolean returnHashInputData, + String trustProfileID, + boolean extendedValidation) { + final VerifyXMLSignatureRequestImpl verifyXMLSignatureRequest = new VerifyXMLSignatureRequestImpl(); + verifyXMLSignatureRequest.setDateTime(dateTime); + verifyXMLSignatureRequest.setSignatureInfo(verifySignatureInfo); + verifyXMLSignatureRequest.setSupplementProfiles(supplementProfiles); + verifyXMLSignatureRequest.setSignatureManifestCheckParams(signatureManifestParams); + verifyXMLSignatureRequest.setReturnHashInputData(returnHashInputData); + verifyXMLSignatureRequest.setTrustProfileId(trustProfileID); + verifyXMLSignatureRequest.setExtendedValidation(extendedValidation); + return verifyXMLSignatureRequest; + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java index 4b50d89..1fc3cdc 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import org.w3c.dom.Element; @@ -30,34 +29,36 @@ import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; /** * Default implementation of <code>SignatureEnvironmentResponse</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class SignatureEnvironmentResponseImpl - implements SignatureEnvironmentResponse { + implements SignatureEnvironmentResponse { /** The signature environment containing the XML signature. */ private Element signatureEnvironment; - /** + /** * Sets the XML structure which contains the signature. - * + * * @param signatureEnvironment A general XML structure containing the signature. */ public void setSignatureEnvironment(Element signatureEnvironment) { this.signatureEnvironment = signatureEnvironment; } + @Override public Element getSignatureEnvironment() { return signatureEnvironment; } /** * Gets the type of <code>CreateXMLSignatureResponseElement</code>. - * + * * @return SIGNATURE_ENVIRONMENT_RESPONSE */ + @Override public int getResponseType() { return SIGNATURE_ENVIRONMENT_RESPONSE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java index 40e87e7..4d4fb64 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,12 +31,12 @@ import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; /** * Default implementation of <code>SignatureManifestCheckParams</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class SignatureManifestCheckParamsImpl - implements SignatureManifestCheckParams { + implements SignatureManifestCheckParams { /** Referential information. */ private List referenceInfos; @@ -46,29 +45,31 @@ public class SignatureManifestCheckParamsImpl /** * Sets the referantial information. - * + * * @param referenceInfos The referential information. */ public void setReferenceInfos(List referenceInfos) { this.referenceInfos = - referenceInfos != null - ? Collections.unmodifiableList(new ArrayList(referenceInfos)) - : null; + referenceInfos != null + ? Collections.unmodifiableList(new ArrayList(referenceInfos)) + : null; } + @Override public List getReferenceInfos() { return referenceInfos; } - + /** * Sets whether to return signature source data. - * + * * @param returnReferenceInputData Whether to return signature source data. */ public void setReturnReferenceInputData(boolean returnReferenceInputData) { this.returnReferenceInputData = returnReferenceInputData; } + @Override public boolean getReturnReferenceInputData() { return returnReferenceInputData; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java index 57a60a6..988ae00 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.security.cert.X509Certificate; @@ -32,7 +31,7 @@ import at.gv.egovernment.moa.spss.api.common.TslInfos; /** * Default implementation of <code>SignerInfo</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -40,145 +39,161 @@ public class SignerInfoImpl implements SignerInfo { /** The signer certificate. */ private X509Certificate signerCertificate; - /** Determines, whether <code>signerCertificate</code> is a qualified - * certificate. */ + /** + * Determines, whether <code>signerCertificate</code> is a qualified + * certificate. + */ private boolean qualifiedCertificate; - /** Determines, whether <code>signerCertificate</code> is from a public - * authority. */ + /** + * Determines, whether <code>signerCertificate</code> is from a public + * authority. + */ private boolean publicAuthority; /** The public authority ID of the <code>signerCertificate</code>. */ private String publicAuthorityID; /** Determines, whether the signature is based on an SSCD */ private boolean sscd; - + /** Determines, if the SSCD check bases upon on TSL */ private boolean sscdSourceTSL; - + /** Determines, if the QC check bases upon on TSL */ private boolean qcSourceTSL; - + /** The certificate issuer country code */ private String issuerCountryCode; - private Date signingTime; - private TslInfos tslInfos; + private Date signingTime; + private TslInfos tslInfos; /** - * Sets the signer certificate. - * - * @param signerCertificate The signer certificate. - */ + * Sets the signer certificate. + * + * @param signerCertificate The signer certificate. + */ public void setSignerCertificate(X509Certificate signerCertificate) { this.signerCertificate = signerCertificate; } + @Override public X509Certificate getSignerCertificate() { return signerCertificate; } /** * Sets, whether the certificate contained in this object is qualified or not. - * - * @param qualifiedCertificate Is <code>true</code>, if the certificate is - * qualified, otherwise <code>false</code>. + * + * @param qualifiedCertificate Is <code>true</code>, if the certificate is + * qualified, otherwise <code>false</code>. */ public void setQualifiedCertificate(boolean qualifiedCertificate) { this.qualifiedCertificate = qualifiedCertificate; } + @Override public boolean isQualifiedCertificate() { return qualifiedCertificate; } /** * Sets, whether the signature is based on an SSCS or not. - * - * @param sscd Is <code>true</code>, if the signature is - * based on an SSCD, otherwise <code>false</code>. + * + * @param sscd Is <code>true</code>, if the signature is based on an SSCD, + * otherwise <code>false</code>. */ public void setSSCD(boolean sscd) { this.sscd = sscd; } + + @Override public boolean isSSCD() { - return sscd; + return sscd; } - + public void setSSCDSourceTSL(boolean sscdSourceTSL) { - this.sscdSourceTSL = sscdSourceTSL; + this.sscdSourceTSL = sscdSourceTSL; } - + + @Override public String getSSCDSource() { - if (sscdSourceTSL) - return "TSL"; - else - return "Certificate"; + if (sscdSourceTSL) { + return "TSL"; + } else { + return "Certificate"; + } } - public Date getSigningTime() { - return signingTime; - } + @Override + public Date getSigningTime() { + return signingTime; + } - public void setSigningTime(Date signingTime) { - this.signingTime = signingTime; - } + public void setSigningTime(Date signingTime) { + this.signingTime = signingTime; + } - public void setQCSourceTSL(boolean qcSourceTSL) { - this.qcSourceTSL = qcSourceTSL; + public void setQCSourceTSL(boolean qcSourceTSL) { + this.qcSourceTSL = qcSourceTSL; } - + + @Override public String getQCSource() { - if (this.qcSourceTSL) - return "TSL"; - else - return "Certificate"; + if (this.qcSourceTSL) { + return "TSL"; + } else { + return "Certificate"; + } } - + public void setIssuerCountryCode(String issuerCountryCode) { - this.issuerCountryCode = issuerCountryCode; + this.issuerCountryCode = issuerCountryCode; } - public String getIssuerCountryCode() { - return issuerCountryCode; - } - + + @Override + public String getIssuerCountryCode() { + return issuerCountryCode; + } + /** - * Sets, whether the certificate contained in this object is an - * e-government certificate or not. - * - * @param publicAuthority Is <code>true</code>, if the certificate is - * public authority certificate, otherwise <code>false</code>. + * Sets, whether the certificate contained in this object is an e-government + * certificate or not. + * + * @param publicAuthority Is <code>true</code>, if the certificate is public + * authority certificate, otherwise <code>false</code>. */ public void setPublicAuthority(boolean publicAuthority) { this.publicAuthority = publicAuthority; } + @Override public boolean isPublicAuthority() { return publicAuthority; } /** * Sets the public authority ID of the signer certificate. - * + * * @param publicAuhtorityID The public authority ID of the signer certificate. */ public void setPublicAuhtorityID(String publicAuhtorityID) { this.publicAuthorityID = publicAuhtorityID; } + @Override public String getPublicAuhtorityID() { return publicAuthorityID; } @Override public TslInfos getTslInfos() { - return this.tslInfos; - - } + return this.tslInfos; + } public void setTslInfos(TslInfos tslInfos) { - this.tslInfos = tslInfos; - + this.tslInfos = tslInfos; + } - - } + +} diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoCMSImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoCMSImpl.java index c8558dc..bbe3ea5 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoCMSImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoCMSImpl.java @@ -21,13 +21,8 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import at.gv.egovernment.moa.spss.api.cmssign.DataObjectInfo; import at.gv.egovernment.moa.spss.api.cmssign.SingleSignatureInfo; @@ -38,7 +33,6 @@ public class SingleSignatureInfoCMSImpl implements SingleSignatureInfo { private DataObjectInfo dataObjectInfo = null; - private boolean securityLayerConform = true; private boolean padesConform = false; @@ -46,22 +40,25 @@ public class SingleSignatureInfoCMSImpl implements SingleSignatureInfo { this.dataObjectInfo = dataObjectInfo; } + @Override public DataObjectInfo getDataObjectInfo() { return dataObjectInfo; } + @Override public boolean isPAdESConform() { - return padesConform; + return padesConform; } public void setPAdESConform(boolean padesConform) { - this.padesConform = padesConform; + this.padesConform = padesConform; } -public void setSecurityLayerConform(boolean securityLayerConform) { + public void setSecurityLayerConform(boolean securityLayerConform) { this.securityLayerConform = securityLayerConform; } + @Override public boolean isSecurityLayerConform() { return securityLayerConform; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java index 3d43068..1fc20a0 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -45,11 +44,12 @@ public class SingleSignatureInfoImpl implements SingleSignatureInfo { public void setDataObjectInfos(List dataObjectInfos) { this.dataObjectInfos = - dataObjectInfos != null - ? Collections.unmodifiableList(new ArrayList(dataObjectInfos)) - : null; + dataObjectInfos != null + ? Collections.unmodifiableList(new ArrayList(dataObjectInfos)) + : null; } + @Override public List getDataObjectInfos() { return dataObjectInfos; } @@ -58,6 +58,7 @@ public class SingleSignatureInfoImpl implements SingleSignatureInfo { this.createSignatureInfo = createSignatureInfo; } + @Override public CreateSignatureInfo getCreateSignatureInfo() { return createSignatureInfo; } @@ -66,6 +67,7 @@ public class SingleSignatureInfoImpl implements SingleSignatureInfo { this.securityLayerConform = securityLayerConform; } + @Override public boolean isSecurityLayerConform() { return securityLayerConform; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java index 7f80388..82a1a0d 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; @@ -29,7 +28,7 @@ import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileExplicit; /** * Default implementation of <code>SupplementProfileExplicit</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -40,22 +39,24 @@ public class SupplementProfileExplicitImpl implements SupplementProfileExplicit /** * Sets the supplemental information for verifying a signature. - * + * * @param supplement The supplemental information for verifying a signature. */ public void setSupplementProfile(XMLDataObjectAssociation supplement) { this.supplement = supplement; } - + + @Override public XMLDataObjectAssociation getSupplementProfile() { return supplement; } /** * Gets the type of <code>SupplementProfile</code>. - * + * * @return EXPLICIT_SUPPLEMENTPROFILE */ + @Override public int getSupplementProfileType() { return EXPLICIT_SUPPLEMENTPROFILE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java index e73ce60..7e64c93 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java @@ -21,39 +21,40 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileID; /** * Default implementation of <code>SupplementProfileID</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class SupplementProfileIDImpl implements SupplementProfileID { /** The profile ID. */ private String profileID; - + /** * Sets the <code>SupplementProfile</code> profile ID. - * + * * @param profileID The profile ID. */ public void setSupplementProfileID(String profileID) { this.profileID = profileID; } + @Override public String getSupplementProfileID() { return profileID; } /** * Gets the type of <code>SupplementProfile</code>. - * + * * @return ID_SUPPLEMENTPROFILE */ + @Override public int getSupplementProfileType() { return ID_SUPPLEMENTPROFILE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TSLConfigurationImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TSLConfigurationImpl.java index 6fa813f..cf3bfc7 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TSLConfigurationImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TSLConfigurationImpl.java @@ -21,99 +21,101 @@ * that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.api.impl;
-import iaik.xml.crypto.utils.URI;
-
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import at.gv.egovernment.moa.spss.api.common.TSLConfiguration;
+import iaik.xml.crypto.utils.URI;
/**
* Default implementation of <code>TSLConfiguration</code>.
- *
+ *
* @author kstranacher
*/
public class TSLConfigurationImpl implements TSLConfiguration {
-
-
- /** The EU TSL URL. */
- private String euTSLUrl;
-
- /** update period in milliseconds */
- private long updateSchedulePeriod;
-
- /** Time of the first update */
- private Date updateScheduleStartTime;
-
- /** Working directory */
- private String workingDirectory;
-
- /** Working directory */
- private URI workingDirectoryAsURI;
-
- private List<java.net.URI> qualifierForQC = new ArrayList<java.net.URI>();
- private List<java.net.URI> qualifierForSSCD = new ArrayList<java.net.URI>();
-
+ /** The EU TSL URL. */
+ private String euTSLUrl;
+
+ /** update period in milliseconds */
+ private long updateSchedulePeriod;
+
+ /** Time of the first update */
+ private Date updateScheduleStartTime;
+
+ /** Working directory */
+ private String workingDirectory;
+
+ /** Working directory */
+ private URI workingDirectoryAsURI;
+
+ private final List<java.net.URI> qualifierForQC = new ArrayList<>();
+ private final List<java.net.URI> qualifierForSSCD = new ArrayList<>();
+
+ @Override
public String getEuTSLUrl() {
- return this.euTSLUrl;
+ return this.euTSLUrl;
}
+ @Override
public long getUpdateSchedulePeriod() {
- return this.updateSchedulePeriod;
+ return this.updateSchedulePeriod;
}
+ @Override
public Date getUpdateScheduleStartTime() {
- return this.updateScheduleStartTime;
+ return this.updateScheduleStartTime;
}
+ @Override
public String getWorkingDirectory() {
- return this.workingDirectory;
+ return this.workingDirectory;
}
-
+
+ @Override
public URI getWorkingDirectoryAsURI() {
- return this.workingDirectoryAsURI;
+ return this.workingDirectoryAsURI;
}
- public void setEuTSLUrl(String euTSLUrl) {
- this.euTSLUrl = euTSLUrl;
- }
-
- public void setUpdateSchedulePeriod(long updateSchedulePeriod) {
- this.updateSchedulePeriod = updateSchedulePeriod;
- }
-
- public void setUpdateScheduleStartTime(Date updateScheduleStartTime) {
- this.updateScheduleStartTime = updateScheduleStartTime;
- }
-
- public void setWorkingDirectory(String workingDirectory) {
- this.workingDirectory = workingDirectory;
- }
-
- public void setWorkingDirectoryURI(URI workingDirectoryAsURI) {
- this.workingDirectoryAsURI = workingDirectoryAsURI;
- }
-
- public List<java.net.URI> getQualifierForQC() {
- return qualifierForQC;
- }
-
- public List<java.net.URI> getQualifierForSSCD() {
- return qualifierForSSCD;
- }
-
- public void addQualifierForQC(java.net.URI qualifier) {
- qualifierForQC.add(qualifier);
- }
-
- public void addQualifierForSSCD(java.net.URI qualifier) {
- qualifierForSSCD.add(qualifier);
- }
-
+ public void setEuTSLUrl(String euTSLUrl) {
+ this.euTSLUrl = euTSLUrl;
+ }
+
+ public void setUpdateSchedulePeriod(long updateSchedulePeriod) {
+ this.updateSchedulePeriod = updateSchedulePeriod;
+ }
+
+ public void setUpdateScheduleStartTime(Date updateScheduleStartTime) {
+ this.updateScheduleStartTime = updateScheduleStartTime;
+ }
+
+ public void setWorkingDirectory(String workingDirectory) {
+ this.workingDirectory = workingDirectory;
+ }
+
+ public void setWorkingDirectoryURI(URI workingDirectoryAsURI) {
+ this.workingDirectoryAsURI = workingDirectoryAsURI;
+ }
+
+ @Override
+ public List<java.net.URI> getQualifierForQC() {
+ return qualifierForQC;
+ }
+
+ @Override
+ public List<java.net.URI> getQualifierForSSCD() {
+ return qualifierForSSCD;
+ }
+
+ public void addQualifierForQC(java.net.URI qualifier) {
+ qualifierForQC.add(qualifier);
+ }
+
+ public void addQualifierForSSCD(java.net.URI qualifier) {
+ qualifierForSSCD.add(qualifier);
+ }
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java index 37a05f9..c72a445 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.Transform; @@ -36,13 +35,14 @@ public class TransformImpl implements Transform { /** * Sets the URI identifying the transformation algorithm. - * + * * @param algorithmURI The URI identifying the transformation algorithm. */ public void setAlgorithmURI(String algorithmURI) { this.algorithmURI = algorithmURI; } + @Override public String getAlgorithmURI() { return algorithmURI; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java index 691f3a9..915aff3 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.io.InputStream; @@ -30,35 +29,37 @@ import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterBinary; /** * Default implementation of <code>TransformParameterBinary</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class TransformParameterBinaryImpl - extends TransformParameterImpl - implements TransformParameterBinary { - + extends TransformParameterImpl + implements TransformParameterBinary { + /** The binary content as a stream. */ private InputStream binaryContent; /** * Sets the binary content as a stream. - * + * * @param binaryContent The binary content as a stream. */ public void setBinaryContent(InputStream binaryContent) { this.binaryContent = binaryContent; } + @Override public InputStream getBinaryContent() { return binaryContent; } /** * Gets the <code>TransformParameter</code> type. - * + * * @return BINARY_TRANSFORMPARAMETER */ + @Override public int getTransformParameterType() { return BINARY_TRANSFORMPARAMETER; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java index 1399c6e..1837d0f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; /** * Default base implementation of <code>TransformParameter</code>. - * + * * @author Patrick Peck * @version $Id$ */ @@ -36,6 +35,7 @@ public abstract class TransformParameterImpl { /** * Sets the URI identifying the <code>TransformParameter</code>. + * * @param uri The URI identifying the <code>TransformParameter</code>. */ public void setURI(String uri) { diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java index 77810be..2671623 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java @@ -21,26 +21,26 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterURI; /** * Default implementation of <code>TransformParameterURI</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class TransformParameterURIImpl - extends TransformParameterImpl - implements TransformParameterURI { + extends TransformParameterImpl + implements TransformParameterURI { /** * Gets the type of <code>TransformParameter</code>. - * + * * @return URI_TRANSFORMPARAMETER */ + @Override public int getTransformParameterType() { return URI_TRANSFORMPARAMETER; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java index 7fcd72c..79fd640 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java @@ -21,20 +21,19 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterHash; /** * Default implementation of <code>TransformParameterHash</code> - * + * * @author Fatemeh Philippi * @version $Id$ */ public class TransformPatameterHashImpl - extends TransformParameterImpl - implements TransformParameterHash { + extends TransformParameterImpl + implements TransformParameterHash { /** The method used to calculate the digest value. */ private String digestMethod; @@ -43,34 +42,38 @@ public class TransformPatameterHashImpl /** * Sets method used to calculate the digest value. + * * @param digestMethod The method used to calculate the digest value. */ public void setDigestMethod(String digestMethod) { this.digestMethod = digestMethod; } + @Override public String getDigestMethod() { return digestMethod; } /** * Sets the digest value. - * + * * @param digestValue The digest value. */ public void setDigestValue(byte[] digestValue) { this.digestValue = digestValue; } - + + @Override public byte[] getDigestValue() { return digestValue; } /** * Gets the type of <code>TransformParameter</code>. - * + * * @return HASH_TRANSFORMPARAMETER */ + @Override public int getTransformParameterType() { return HASH_TRANSFORMPARAMETER; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TslInfosImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TslInfosImpl.java index fad42e6..26905c2 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TslInfosImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TslInfosImpl.java @@ -8,55 +8,55 @@ import at.gv.egovernment.moa.spss.api.common.TslInfos; public class TslInfosImpl implements TslInfos { - private String tslServiceTypeIdentifier; - private String tslServiceTypeStatus; - private List<String> tslServiceQualifier = new ArrayList<String>(); - private List<String> tslAdditionalServiceInformation = new ArrayList<String>(); - private String tslCountry; - - public TslInfosImpl(String country, String tslServiceTypeStatus, String tslServiceTypeIdentifier, - List<URI> tslCertificateQualifier, List<String> additionalServiceInformation) { - this.tslCountry = country; - this.tslServiceTypeStatus = tslServiceTypeStatus; - this.tslServiceTypeIdentifier = tslServiceTypeIdentifier; - - if (tslCertificateQualifier != null) { - for (URI el : tslCertificateQualifier) - this.tslServiceQualifier.add(el.toString()); - - } - - if (additionalServiceInformation != null) - this.tslAdditionalServiceInformation.addAll(additionalServiceInformation); - - } - - - @Override - public String getTslIssuerCountry() { - return tslCountry; - } - - @Override - public String getServiceTypeStatus() { - return tslServiceTypeStatus; - } - - @Override - public String getServiceTypeIdentifier() { - return tslServiceTypeIdentifier; - } - - @Override - public List<String> getQualifiers() { - return tslServiceQualifier; - } - - - @Override - public List<String> getAdditionalServiceInformation() { - return this.tslAdditionalServiceInformation; - - } + private final String tslServiceTypeIdentifier; + private final String tslServiceTypeStatus; + private final List<String> tslServiceQualifier = new ArrayList<>(); + private final List<String> tslAdditionalServiceInformation = new ArrayList<>(); + private final String tslCountry; + + public TslInfosImpl(String country, String tslServiceTypeStatus, String tslServiceTypeIdentifier, + List<URI> tslCertificateQualifier, List<String> additionalServiceInformation) { + this.tslCountry = country; + this.tslServiceTypeStatus = tslServiceTypeStatus; + this.tslServiceTypeIdentifier = tslServiceTypeIdentifier; + + if (tslCertificateQualifier != null) { + for (final URI el : tslCertificateQualifier) { + this.tslServiceQualifier.add(el.toString()); + } + + } + + if (additionalServiceInformation != null) { + this.tslAdditionalServiceInformation.addAll(additionalServiceInformation); + } + + } + + @Override + public String getTslIssuerCountry() { + return tslCountry; + } + + @Override + public String getServiceTypeStatus() { + return tslServiceTypeStatus; + } + + @Override + public String getServiceTypeIdentifier() { + return tslServiceTypeIdentifier; + } + + @Override + public List<String> getQualifiers() { + return tslServiceQualifier; + } + + @Override + public List<String> getAdditionalServiceInformation() { + return this.tslAdditionalServiceInformation; + + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java index e16717d..f041835 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.io.InputStream; @@ -32,12 +31,12 @@ import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; /** * Default implementation of <code>VerifyCMSSignatureRequest</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class VerifyCMSSignatureRequestImpl - implements VerifyCMSSignatureRequest { + implements VerifyCMSSignatureRequest { /** The indexes of the signatories whose signature should be verified. */ private int[] signatories; @@ -49,39 +48,42 @@ public class VerifyCMSSignatureRequestImpl private InputStream cmsSignature; /** The date for which to verify the signature. */ private Date dateTime; - + private boolean pdf = false; private boolean extended = false; /** * Sets the indexes of the signatories whose signature should be verified. - * - * @param signatories The indexes of the signatories whose signature should be - * verified. + * + * @param signatories The indexes of the signatories whose signature should be + * verified. */ public void setSignatories(int[] signatories) { this.signatories = signatories; } + @Override public int[] getSignatories() { return signatories; } /** * Sets the date for which to verify the signature. - * + * * @param dateTime The date for which to verify the signature. */ public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + @Override public Date getDateTime() { return dateTime; } /** * Sets the CMS signature to verify. + * * @param signature The CMS signature to verify. */ public void setCMSSignature(InputStream signature) { @@ -89,48 +91,55 @@ public class VerifyCMSSignatureRequestImpl } + @Override public InputStream getCMSSignature() { return cmsSignature; } /** * Sets the data object necessary for signature verification. + * * @param dataObject The data object necessary for signature verification. */ public void setDataObject(CMSDataObject dataObject) { this.dataObject = dataObject; } + @Override public CMSDataObject getDataObject() { return dataObject; } /** * Sets the profile ID of trusted certificates. + * * @param trustProfileId The profile ID of trusted certificates. */ public void setTrustProfileId(String trustProfileId) { this.trustProfileId = trustProfileId; } + @Override public String getTrustProfileId() { return trustProfileId; } public void setPDF(boolean value) { - this.pdf = value; + this.pdf = value; } - + + @Override public boolean isPDF() { - return this.pdf; + return this.pdf; } -public synchronized boolean isExtended() { - return extended; -} + @Override + public synchronized boolean isExtended() { + return extended; + } -public synchronized void setExtended(boolean extended) { - this.extended = extended; -} + public synchronized void setExtended(boolean extended) { + this.extended = extended; + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java index 3ea504b..f9e8e4d 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.List; @@ -33,12 +32,12 @@ import at.gv.egovernment.moa.spss.api.common.SignerInfo; /** * Default implementation of <code>VerifyCMSSignatureResponseElement</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class VerifyCMSSignatureResponseElementImpl - implements VerifyCMSSignatureResponseElement { + implements VerifyCMSSignatureResponseElement { /** Information about the signer certificate. */ private SignerInfo signerInfo; @@ -46,101 +45,102 @@ public class VerifyCMSSignatureResponseElementImpl private CheckResult signatureCheck; /** Information about the certificate check. */ private CheckResult certificateCheck; - + private ExtendedCertificateCheckResult extendedResult; - + private List adesResults = null; - + private String usedAlgorithm = null; - + private Boolean coversFullDocument = null; - + private int[] byteRangeOfSignature = null; - + /** * Sets a SignerInfo element according to CMS. - * + * * @param signerInfo The SignerInfo element according to CMS. */ public void setSignerInfo(SignerInfo signerInfo) { this.signerInfo = signerInfo; } + @Override public SignerInfo getSignerInfo() { return signerInfo; } /** * Sets a result of the signature verification. - * + * * @param signatureCheck The result of the signature verification. */ public void setSignatureCheck(CheckResult signatureCheck) { this.signatureCheck = signatureCheck; } + @Override public CheckResult getSignatureCheck() { return signatureCheck; } /** * Sets a result of the certificate verification. - * + * * @param certificateCheck The result of the certificate verification. */ public void setCertificateCheck(CheckResult certificateCheck) { this.certificateCheck = certificateCheck; } + @Override public CheckResult getCertificateCheck() { return certificateCheck; } public void setAdESFormResults(List adesResults) { - this.adesResults = adesResults; + this.adesResults = adesResults; } - + + @Override public List getAdESFormResults() { - return adesResults; + return adesResults; } public void setExtendedCertificateCheck(ExtendedCertificateCheckResult r) { - this.extendedResult = r; - } - - @Override - public ExtendedCertificateCheckResult getExtendedCertificateCheck() { - return extendedResult; - } - - @Override - public String getSignatureAlgorithm() { - return usedAlgorithm; - } - - public void setSignatureAlgorithm(String usedAlgorithm) { - this.usedAlgorithm = usedAlgorithm; - } - - @Override - public Boolean getCoversFullDocument() { - return coversFullDocument; - } - - public void setCoversFullDocument(Boolean coversFullDocument) { - this.coversFullDocument = coversFullDocument; - } - - @Override - public int[] getByteRangeOfSignature() { - return byteRangeOfSignature; - } - - public void setByteRangeOfSignature(int[] byteRangeOfSignature) { - this.byteRangeOfSignature = byteRangeOfSignature; - } - - - - + this.extendedResult = r; + } + + @Override + public ExtendedCertificateCheckResult getExtendedCertificateCheck() { + return extendedResult; + } + + @Override + public String getSignatureAlgorithm() { + return usedAlgorithm; + } + + public void setSignatureAlgorithm(String usedAlgorithm) { + this.usedAlgorithm = usedAlgorithm; + } + + @Override + public Boolean getCoversFullDocument() { + return coversFullDocument; + } + + public void setCoversFullDocument(Boolean coversFullDocument) { + this.coversFullDocument = coversFullDocument; + } + + @Override + public int[] getByteRangeOfSignature() { + return byteRangeOfSignature; + } + + public void setByteRangeOfSignature(int[] byteRangeOfSignature) { + this.byteRangeOfSignature = byteRangeOfSignature; + } + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java index 44fb474..c7fd29f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,28 +31,29 @@ import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; /** * Default implementation of <code>VerifyCMSSignatureResponse</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class VerifyCMSSinatureResponseImpl - implements VerifyCMSSignatureResponse { + implements VerifyCMSSignatureResponse { /** The elements contained in the response. */ private List responseElements; /** * Sets the elements contained in the response. - * + * * @param responseElements The elements contained in the response. */ public void setResponseElements(List responseElements) { this.responseElements = - responseElements != null - ? Collections.unmodifiableList(new ArrayList(responseElements)) - : null; + responseElements != null + ? Collections.unmodifiableList(new ArrayList(responseElements)) + : null; } + @Override public List getResponseElements() { return responseElements; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java index d022ae4..f8ab10d 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.Content; @@ -30,7 +29,7 @@ import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; /** * Default implementation of <code>VerifySignatureInfo</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -42,28 +41,29 @@ public class VerifySignatureInfoImpl implements VerifySignatureInfo { /** * Sets the location of the signature to be verified. - * - * @param verifySignatureLocation The location of the signature to be - * verified. + * + * @param verifySignatureLocation The location of the signature to be verified. */ public void setVerifySignatureLocation(VerifySignatureLocation verifySignatureLocation) { this.verifySignatureLocation = verifySignatureLocation; } + @Override public VerifySignatureLocation getVerifySignatureLocation() { return verifySignatureLocation; } /** * Sets the signature environment containing the signature to be verified. - * - * @param verifySignatureEnvironment The signature environment containing the - * signature to be verified. + * + * @param verifySignatureEnvironment The signature environment containing the + * signature to be verified. */ public void setVerifySignatureEnvironment(Content verifySignatureEnvironment) { this.verifySignatureEnvironment = verifySignatureEnvironment; } + @Override public Content getVerifySignatureEnvironment() { return verifySignatureEnvironment; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java index 8e183bb..7f3b381 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java @@ -21,19 +21,18 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; /** * Default implementation of <code>VerifySignatureLocation</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class VerifySignatureLocationImpl - extends ElementSelectorImpl - implements VerifySignatureLocation { + extends ElementSelectorImpl + implements VerifySignatureLocation { } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java index 25b5c39..d1eebca 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,7 +31,7 @@ import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; /** * Default implementation of <codeReferenceInfo</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -42,18 +41,19 @@ public class VerifyTransformsDataImpl implements ReferenceInfo { /** * Sets the information about the transformations contained in the signature. - * + * * @param verifyTransformsInfoProfiles The profiles containing transformation - * information. + * information. */ public void setVerifyTransformsInfoProfiles(List verifyTransformsInfoProfiles) { this.verifyTransformsInfoProfiles = - verifyTransformsInfoProfiles != null - ? Collections.unmodifiableList( - new ArrayList(verifyTransformsInfoProfiles)) - : null; + verifyTransformsInfoProfiles != null + ? Collections.unmodifiableList( + new ArrayList(verifyTransformsInfoProfiles)) + : null; } + @Override public List getVerifyTransformsInfoProfiles() { return verifyTransformsInfoProfiles; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java index 2ce5f39..0e1e46e 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -32,12 +31,12 @@ import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExpli /** * Default implementation of <code>VerifyTransformsInfoProfileExplicit</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class VerifyTransformsInfoProfileExplicitImpl - implements VerifyTransformsInfoProfileExplicit { + implements VerifyTransformsInfoProfileExplicit { /** The transforms contained in this profile. */ private List transforms; @@ -46,38 +45,41 @@ public class VerifyTransformsInfoProfileExplicitImpl /** * Sets the transforms contained in this profile. - * + * * @param transforms The transforms contained in this profile. */ public void setTransforms(List transforms) { this.transforms = - transforms != null - ? Collections.unmodifiableList(new ArrayList(transforms)) - : null; + transforms != null + ? Collections.unmodifiableList(new ArrayList(transforms)) + : null; } + @Override public List getTransforms() { return transforms; } /** * Sets additional information for the transforms. - * + * * @param transformParameters Additional information for the transforms. */ public void setTransformParameters(List transformParameters) { this.transformParameters = new ArrayList(transformParameters); } + @Override public List getTransformParameters() { return transformParameters; } /** * Gets the type of <code>VerifyTransformsInfoProfile</code>. - * + * * @return EXPLICIT_VERIFYTRANSFORMSINFOPROFILE */ + @Override public int getVerifyTransformsInfoProfileType() { return EXPLICIT_VERIFYTRANSFORMSINFOPROFILE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java index a545535..56fc9e2 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileID; /** * Default implementation of <code>VerifyTransformsInfoProfileID</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -39,22 +38,24 @@ public class VerifyTransformsInfoProfileIDImpl implements VerifyTransformsInfoPr /** * Sets the profile ID. - * + * * @param profileID The profile ID. */ public void setVerifyTransformsInfoProfileID(String profileID) { this.verifyTransformsInfoProfileID = profileID; } + @Override public String getVerifyTransformsInfoProfileID() { return verifyTransformsInfoProfileID; } /** * Gets the type of <code>VerifyTransformsInfoProfile</code>. - * + * * @return ID_VERIFYTRANSFORMSINFOPROFILE */ + @Override public int getVerifyTransformsInfoProfileType() { return ID_VERIFYTRANSFORMSINFOPROFILE; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java index 91d1917..b5094b4 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java @@ -34,118 +34,120 @@ import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; /** * Default implementation of <code>VerifyXMLSignatureRequest</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class VerifyXMLSignatureRequestImpl implements VerifyXMLSignatureRequest { - /** Date and time for signature verification. */ - private Date dateTime; - /** The signature to be verified. */ - private VerifySignatureInfo verifySignatureInfo; - /** Supplemental information about the singature. */ - private List supplementProfiles; - /** Additional parameters for checking the signature manifest. */ - private SignatureManifestCheckParams signatureManifestCheckParams; - /** Whether to return the hash input data. */ - private boolean returnHashInputData; - private boolean extendedValidation; - /** - * The profile ID of the trust profile containing the trusted certificates. - */ - private String trustProfileId; - - /** - * Sets the date and time for signature verification. - * - * @param dateTime - * The date and time for signature verification. - */ - public void setDateTime(Date dateTime) { - this.dateTime = dateTime; - } - - public Date getDateTime() { - return dateTime; - } - - /** - * Sets the signature to be verified. - * - * @param signatureInfo - * The signature to be verified. - */ - public void setSignatureInfo(VerifySignatureInfo signatureInfo) { - this.verifySignatureInfo = signatureInfo; - } - - public VerifySignatureInfo getSignatureInfo() { - return verifySignatureInfo; - } - - /** - * Sets supplemental information about the singature. - * - * @param supplementProfiles - */ - public void setSupplementProfiles(List supplementProfiles) { - this.supplementProfiles = supplementProfiles != null - ? Collections.unmodifiableList(new ArrayList(supplementProfiles)) : null; - } - - public List getSupplementProfiles() { - return supplementProfiles; - } - - /** - * Sets supplemental information about the singature. - * - * @param params - * Supplemental information about the singature. - */ - public void setSignatureManifestCheckParams(SignatureManifestCheckParams params) { - this.signatureManifestCheckParams = params; - } - - public SignatureManifestCheckParams getSignatureManifestCheckParams() { - return signatureManifestCheckParams; - } - - /** - * Sets whether to return hash input data. - * - * @param returnSignedData - * Whether to return hash input data. - */ - public void setReturnHashInputData(boolean returnSignedData) { - this.returnHashInputData = returnSignedData; - } - - public boolean getReturnHashInputData() { - return returnHashInputData; - } - - /** - * Sets the profile ID of trusted certificates. - * - * @param trustProfileId - * The profile ID of trusted certificates. - */ - public void setTrustProfileId(String trustProfileId) { - this.trustProfileId = trustProfileId; - } - - public String getTrustProfileId() { - return trustProfileId; - } - - public synchronized void setExtendedValidation(boolean extendedValidation) { - this.extendedValidation = extendedValidation; - } - - @Override - public boolean getExtendedValidaiton() { - return extendedValidation; - } + /** Date and time for signature verification. */ + private Date dateTime; + /** The signature to be verified. */ + private VerifySignatureInfo verifySignatureInfo; + /** Supplemental information about the singature. */ + private List supplementProfiles; + /** Additional parameters for checking the signature manifest. */ + private SignatureManifestCheckParams signatureManifestCheckParams; + /** Whether to return the hash input data. */ + private boolean returnHashInputData; + private boolean extendedValidation; + /** + * The profile ID of the trust profile containing the trusted certificates. + */ + private String trustProfileId; + + /** + * Sets the date and time for signature verification. + * + * @param dateTime The date and time for signature verification. + */ + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + @Override + public Date getDateTime() { + return dateTime; + } + + /** + * Sets the signature to be verified. + * + * @param signatureInfo The signature to be verified. + */ + public void setSignatureInfo(VerifySignatureInfo signatureInfo) { + this.verifySignatureInfo = signatureInfo; + } + + @Override + public VerifySignatureInfo getSignatureInfo() { + return verifySignatureInfo; + } + + /** + * Sets supplemental information about the singature. + * + * @param supplementProfiles + */ + public void setSupplementProfiles(List supplementProfiles) { + this.supplementProfiles = supplementProfiles != null + ? Collections.unmodifiableList(new ArrayList(supplementProfiles)) + : null; + } + + @Override + public List getSupplementProfiles() { + return supplementProfiles; + } + + /** + * Sets supplemental information about the singature. + * + * @param params Supplemental information about the singature. + */ + public void setSignatureManifestCheckParams(SignatureManifestCheckParams params) { + this.signatureManifestCheckParams = params; + } + + @Override + public SignatureManifestCheckParams getSignatureManifestCheckParams() { + return signatureManifestCheckParams; + } + + /** + * Sets whether to return hash input data. + * + * @param returnSignedData Whether to return hash input data. + */ + public void setReturnHashInputData(boolean returnSignedData) { + this.returnHashInputData = returnSignedData; + } + + @Override + public boolean getReturnHashInputData() { + return returnHashInputData; + } + + /** + * Sets the profile ID of trusted certificates. + * + * @param trustProfileId The profile ID of trusted certificates. + */ + public void setTrustProfileId(String trustProfileId) { + this.trustProfileId = trustProfileId; + } + + @Override + public String getTrustProfileId() { + return trustProfileId; + } + + public synchronized void setExtendedValidation(boolean extendedValidation) { + this.extendedValidation = extendedValidation; + } + + @Override + public boolean getExtendedValidaiton() { + return extendedValidation; + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java index 0047d44..85af8d4 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java @@ -39,165 +39,168 @@ import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; */ public class VerifyXMLSignatureResponseImpl implements VerifyXMLSignatureResponse { - /** Information about the signer certificate. */ - private SignerInfo signerInfo; - - private ExtendedCertificateCheckResult extendedResult; - - /** - * The hash input data objects. The list consists of - * {@link at.gv.egovernment.moa.spss.api.common.InputData}s. - */ - private List hashInputDatas = new ArrayList(); - - /** - * The reference input data objects. The list consists of - * {@link at.gv.egovernment.moa.spss.api.common.InputData}s. - */ - private List referenceInputDatas = new ArrayList(); - - /** - * The list of form validation results - */ - private List adesFormResults = new ArrayList(); - - /** Information about the signature check. */ - private ReferencesCheckResult signatureCheck; - /** Information about the signature manifest check. */ - private ReferencesCheckResult signatureManifestCheck; - /** Information about the XMLDsig manifest check. */ - private List xmlDsigManifestChecks = new ArrayList(); - /** Information about the certificate check. */ - private CheckResult certificateCheck; - - private String signatureAlgorithm = null; - - /** - * Sets information about the signer certificate. - * - * @param signerInfo - * Information about the signer certificate. - */ - public void setSignerInfo(SignerInfo signerInfo) { - this.signerInfo = signerInfo; - } - - public SignerInfo getSignerInfo() { - return signerInfo; - } - - /** - * Sets data signed by the signatory. - * - * @param hashInputDatas - * The signed datas. - */ - public void setHashInputDatas(List hashInputDatas) { - this.hashInputDatas = hashInputDatas != null ? Collections.unmodifiableList(new ArrayList(hashInputDatas)) - : null; - } - - public List getHashInputDatas() { - return hashInputDatas; - } - - /** - * Sets the source data elements. - * - * @param referenceInputDatas - * The source data elements. - */ - public void setReferenceInputDatas(List referenceInputDatas) { - this.referenceInputDatas = referenceInputDatas != null - ? Collections.unmodifiableList(new ArrayList(referenceInputDatas)) : null; - } - - public List getReferenceInputDatas() { - return referenceInputDatas; - } - - /** - * Sets the result of the signature verification. - * - * @param signatureCheck - * The result of the signature verification. - */ - public void setSignatureCheck(ReferencesCheckResult signatureCheck) { - this.signatureCheck = signatureCheck; - } - - public ReferencesCheckResult getSignatureCheck() { - return signatureCheck; - } - - /** - * Sets the result of the signature manifest verification. - * - * @param signatureManifestCheck - * The result of the signature manifest verification. - */ - public void setSignatureManifestCheck(ReferencesCheckResult signatureManifestCheck) { - this.signatureManifestCheck = signatureManifestCheck; - } - - public ReferencesCheckResult getSignatureManifestCheck() { - return signatureManifestCheck; - } - - /** - * Sets the result of the certification verification. - * - * @param certificateCheck - * The result of the certificate verification. - */ - public void setCertificateCheck(CheckResult certificateCheck) { - this.certificateCheck = certificateCheck; - } - - public CheckResult getCertificateCheck() { - return certificateCheck; - } - - /** - * Sets the XMLDSigManifestChecks. - * - * @param xmlDsigManifestChecks - * The XMLDSigManifestChecks. - */ - public void setXMLDsigManifestChecks(List xmlDsigManifestChecks) { - this.xmlDsigManifestChecks = xmlDsigManifestChecks != null - ? Collections.unmodifiableList(new ArrayList(xmlDsigManifestChecks)) : null; - } - - public List getXMLDsigManifestChecks() { - return xmlDsigManifestChecks; - } - - public void setAdESFormResults(List adesFormResults) { - this.adesFormResults = adesFormResults; - } - - @Override - public List getAdESFormResults() { - return this.adesFormResults; - } - - public void setExtendedCertificateCheck(ExtendedCertificateCheckResult r) { - this.extendedResult = r; - } - - @Override - public ExtendedCertificateCheckResult getExtendedCertificateCheck() { - return extendedResult; - } - - public String getSignatureAlgorithm() { - return signatureAlgorithm; - } - - public void setSignatureAlgorithm(String signatureAlgorithm) { - this.signatureAlgorithm = signatureAlgorithm; - } - - + /** Information about the signer certificate. */ + private SignerInfo signerInfo; + + private ExtendedCertificateCheckResult extendedResult; + + /** + * The hash input data objects. The list consists of + * {@link at.gv.egovernment.moa.spss.api.common.InputData}s. + */ + private List hashInputDatas = new ArrayList(); + + /** + * The reference input data objects. The list consists of + * {@link at.gv.egovernment.moa.spss.api.common.InputData}s. + */ + private List referenceInputDatas = new ArrayList(); + + /** + * The list of form validation results + */ + private List adesFormResults = new ArrayList(); + + /** Information about the signature check. */ + private ReferencesCheckResult signatureCheck; + /** Information about the signature manifest check. */ + private ReferencesCheckResult signatureManifestCheck; + /** Information about the XMLDsig manifest check. */ + private List xmlDsigManifestChecks = new ArrayList(); + /** Information about the certificate check. */ + private CheckResult certificateCheck; + + private String signatureAlgorithm = null; + + /** + * Sets information about the signer certificate. + * + * @param signerInfo Information about the signer certificate. + */ + public void setSignerInfo(SignerInfo signerInfo) { + this.signerInfo = signerInfo; + } + + @Override + public SignerInfo getSignerInfo() { + return signerInfo; + } + + /** + * Sets data signed by the signatory. + * + * @param hashInputDatas The signed datas. + */ + public void setHashInputDatas(List hashInputDatas) { + this.hashInputDatas = hashInputDatas != null ? Collections.unmodifiableList(new ArrayList(hashInputDatas)) + : null; + } + + @Override + public List getHashInputDatas() { + return hashInputDatas; + } + + /** + * Sets the source data elements. + * + * @param referenceInputDatas The source data elements. + */ + public void setReferenceInputDatas(List referenceInputDatas) { + this.referenceInputDatas = referenceInputDatas != null + ? Collections.unmodifiableList(new ArrayList(referenceInputDatas)) + : null; + } + + @Override + public List getReferenceInputDatas() { + return referenceInputDatas; + } + + /** + * Sets the result of the signature verification. + * + * @param signatureCheck The result of the signature verification. + */ + public void setSignatureCheck(ReferencesCheckResult signatureCheck) { + this.signatureCheck = signatureCheck; + } + + @Override + public ReferencesCheckResult getSignatureCheck() { + return signatureCheck; + } + + /** + * Sets the result of the signature manifest verification. + * + * @param signatureManifestCheck The result of the signature manifest + * verification. + */ + public void setSignatureManifestCheck(ReferencesCheckResult signatureManifestCheck) { + this.signatureManifestCheck = signatureManifestCheck; + } + + @Override + public ReferencesCheckResult getSignatureManifestCheck() { + return signatureManifestCheck; + } + + /** + * Sets the result of the certification verification. + * + * @param certificateCheck The result of the certificate verification. + */ + public void setCertificateCheck(CheckResult certificateCheck) { + this.certificateCheck = certificateCheck; + } + + @Override + public CheckResult getCertificateCheck() { + return certificateCheck; + } + + /** + * Sets the XMLDSigManifestChecks. + * + * @param xmlDsigManifestChecks The XMLDSigManifestChecks. + */ + public void setXMLDsigManifestChecks(List xmlDsigManifestChecks) { + this.xmlDsigManifestChecks = xmlDsigManifestChecks != null + ? Collections.unmodifiableList(new ArrayList(xmlDsigManifestChecks)) + : null; + } + + @Override + public List getXMLDsigManifestChecks() { + return xmlDsigManifestChecks; + } + + public void setAdESFormResults(List adesFormResults) { + this.adesFormResults = adesFormResults; + } + + @Override + public List getAdESFormResults() { + return this.adesFormResults; + } + + public void setExtendedCertificateCheck(ExtendedCertificateCheckResult r) { + this.extendedResult = r; + } + + @Override + public ExtendedCertificateCheckResult getExtendedCertificateCheck() { + return extendedResult; + } + + @Override + public String getSignatureAlgorithm() { + return signatureAlgorithm; + } + + public void setSignatureAlgorithm(String signatureAlgorithm) { + this.signatureAlgorithm = signatureAlgorithm; + } + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java index aff7e10..ac2886c 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.math.BigInteger; @@ -30,7 +29,7 @@ import at.gv.egovernment.moa.spss.api.common.X509IssuerSerial; /** * Default implementation of <code>X509IssuerSerial</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -42,26 +41,28 @@ public class X509IssuerSerialImpl implements X509IssuerSerial { /** * Sets the issuer distinguished name. - * + * * @param x509IssuerName The issuer distinguished name. */ public void setX509IssuerName(String x509IssuerName) { this.x509IssuerName = x509IssuerName; } + @Override public String getX509IssuerName() { return x509IssuerName; } /** * Sets the certificate serial number. - * + * * @param x509SerialNumber The issuer serial number. */ public void setX509SerialNumber(BigInteger x509SerialNumber) { this.x509SerialNumber = x509SerialNumber; } + @Override public BigInteger getX509SerialNumber() { return x509SerialNumber; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java index dabf29d..7769e5a 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import at.gv.egovernment.moa.spss.api.common.Content; @@ -30,7 +29,7 @@ import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; /** * Default implementation of <code>XMLDataObjectAssociation</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -43,25 +42,28 @@ public class XMLDataObjectAssociationImpl implements XMLDataObjectAssociation { /** * Sets meta information about the <code>Content</code> object. + * * @param metaInfo Meta information about the <code>Content</code> object. */ public void setMetaInfo(MetaInfo metaInfo) { this.metaInfo = metaInfo; } + @Override public MetaInfo getMetaInfo() { return metaInfo; } /** * Sets the actual data contained in this object. - * + * * @param content The actual data contained in this object. */ public void setContent(Content content) { this.content = content; } + @Override public Content getContent() { return content; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java index 175de3a..9eb4df1 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.ArrayList; @@ -31,17 +30,17 @@ import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; /** * Default implementation of <code>XPathFilter2Transform</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class XPathFilter2TransformImpl - extends TransformImpl - implements XPathFilter2Transform { - + extends TransformImpl + implements XPathFilter2Transform { + /** The XPath filters. */ private List filters; - + /** * Create a new <code>XPathFilter2TransformImpl</code> object. */ @@ -50,16 +49,16 @@ public class XPathFilter2TransformImpl } /** - * Sets the XPath filters contained in this - * <code>XPathFilter2Transform</code>. - * - * @param filters The XPath filters contained in this - * <code>XPathFilter2Transform</code>. - */ + * Sets the XPath filters contained in this <code>XPathFilter2Transform</code>. + * + * @param filters The XPath filters contained in this + * <code>XPathFilter2Transform</code>. + */ public void setFilters(List filters) { this.filters = new ArrayList(filters); } + @Override public List getFilters() { return filters; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java index 6615e9f..800270f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.HashMap; @@ -31,7 +30,7 @@ import at.gv.egovernment.moa.spss.api.common.XPathFilter; /** * Default implementation of <code>XPathFilter</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ @@ -40,47 +39,51 @@ public class XPathFilterImpl implements XPathFilter { private String filterType; /** The XPath expression of the filter. */ private String xPathExpression; - /** The namespace prefix to URI mapping to while evaluating the XPath - * expression. */ + /** + * The namespace prefix to URI mapping to while evaluating the XPath expression. + */ private Map namespaceDeclarations = new HashMap(); /** * Sets the type of filter. - * + * * @param filterType The type of filter. */ public void setFilterType(String filterType) { this.filterType = filterType; } + @Override public String getFilterType() { return filterType; } /** * Sets the XPath expression of the filter. - * + * * @param xPathExpression The XPath expression of the filter. */ public void setXPathExpression(String xPathExpression) { this.xPathExpression = xPathExpression; } + @Override public String getXPathExpression() { return xPathExpression; } /** - * Sets the namespace prefix to URI mapping to while evaluating the XPath + * Sets the namespace prefix to URI mapping to while evaluating the XPath * expression. - * - * @param namespaceDeclarations The namespace prefix to URI mapping to while - * evaluating the XPath expression. + * + * @param namespaceDeclarations The namespace prefix to URI mapping to while + * evaluating the XPath expression. */ public void setNamespaceDelcarations(Map namespaceDeclarations) { this.namespaceDeclarations = namespaceDeclarations; } + @Override public Map getNamespaceDeclarations() { return namespaceDeclarations; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java index f626a95..92f7170 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import java.util.HashMap; @@ -31,18 +30,19 @@ import at.gv.egovernment.moa.spss.api.common.XPathTransform; /** * Default implementation of <code>XPathTransform</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class XPathTransformImpl - extends TransformImpl - implements XPathTransform { - + extends TransformImpl + implements XPathTransform { + /** The XPath expression to evaluate. */ private String xPathExpression; - /** The namespace prefix to URI mapping to while evaluating the XPath - * expression. */ + /** + * The namespace prefix to URI mapping to while evaluating the XPath expression. + */ private Map namespaceDeclarations = new HashMap(); /** @@ -54,28 +54,30 @@ public class XPathTransformImpl /** * Sets the XPath expression to evaluate. - * + * * @param xPathExpression The XPath expression to evaluate. */ public void setXPathExpression(String xPathExpression) { this.xPathExpression = xPathExpression; } + @Override public String getXPathExpression() { return xPathExpression; } /** - * Sets the namespace prefix to URI mapping to while evaluating the XPath + * Sets the namespace prefix to URI mapping to while evaluating the XPath * expression. - * - * @param namespaceDeclarations The namespace prefix to URI mapping to while - * evaluating the XPath expression. + * + * @param namespaceDeclarations The namespace prefix to URI mapping to while + * evaluating the XPath expression. */ public void setNamespaceDelcarations(Map namespaceDeclarations) { this.namespaceDeclarations = namespaceDeclarations; } + @Override public Map getNamespaceDeclarations() { return namespaceDeclarations; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java index 3fd4cc1..5995c73 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.impl; import org.w3c.dom.Element; @@ -30,14 +29,14 @@ import at.gv.egovernment.moa.spss.api.common.XSLTTransform; /** * Default implementation of <code>XSLTTransform</code>. - * + * * @author Fatemeh Philippi * @version $Id$ */ public class XSLTransformImpl extends TransformImpl implements XSLTTransform { /** The XSLT stylesheet to apply. */ private Element styleSheet; - + /** * Create a new <code>XSLTransformImpl</code> object. */ @@ -47,13 +46,14 @@ public class XSLTransformImpl extends TransformImpl implements XSLTTransform { /** * Sets the XSLT stylesheet to apply. - * + * * @param styleSheet The XSLT stylesheet to apply. */ public void setStylesheet(Element styleSheet) { this.styleSheet = styleSheet; } + @Override public Element getStylesheet() { return styleSheet; } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureRequestParser.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureRequestParser.java index a4c4d29..579fb51 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureRequestParser.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureRequestParser.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.io.InputStream; @@ -49,7 +48,7 @@ import at.gv.egovernment.moaspss.util.XPathUtils; /** * A parser to parse <code>CreateCMSSignatureRequest</code> DOM trees into * <code>CreateCMSSignatureRequest</code> API objects. - * + * * @author Patrick Peck * @version $Id$ */ @@ -60,12 +59,12 @@ public class CreateCMSSignatureRequestParser { // private static final String MOA = Constants.MOA_PREFIX + ":"; private static final String KEY_IDENTIFIER_XPATH = - "/" + MOA + "CreateCMSSignatureRequest/" + MOA + "KeyIdentifier"; + "/" + MOA + "CreateCMSSignatureRequest/" + MOA + "KeyIdentifier"; private static final String SINGLE_SIGNATURE_INFO_XPATH = - "/" + MOA + "CreateCMSSignatureRequest/" + MOA + "SingleSignatureInfo"; + "/" + MOA + "CreateCMSSignatureRequest/" + MOA + "SingleSignatureInfo"; private static final String DATA_OBJECT_INFO_XPATH = MOA + "DataObjectInfo"; private static final String DATA_OBJECT_XPATH = MOA + "DataObject"; - + private static final String SL_CONFORM_ATTR_NAME = "SecurityLayerConformity"; private static final String IS_PADES_SIGNATURE_ATTR_NAME = "PAdESConformity"; @@ -74,11 +73,9 @@ public class CreateCMSSignatureRequestParser { private static final String BASE64_CONTENT_XPATH = MOA + "Base64Content"; private static final String EXCLUDEBYTERANGE_FROM_XPATH = MOA + "ExcludedByteRange/" + MOA + "From"; private static final String EXCLUDEBYTERANGE_TO_XPATH = MOA + "ExcludedByteRange/" + MOA + "To"; - - /** The factory to create API objects. */ - private SPSSFactory factory; + private final SPSSFactory factory; /** * Create a new <code>CreateCMSSignatureRequestParser</code>. @@ -88,44 +85,43 @@ public class CreateCMSSignatureRequestParser { } /** - * Parse a <code>CreateCMSSignatureRequest</code> DOM element, as defined - * by the MOA schema. - * + * Parse a <code>CreateCMSSignatureRequest</code> DOM element, as defined by the + * MOA schema. + * * @param requestElem The <code>CreateCMSSignatureRequest</code> to parse. The - * request must have been successfully parsed against the schema for this - * method to succeed. - * @return A <code>CreateCMSSignatureRequest</code> API object containing - * the data from the DOM element. + * request must have been successfully parsed against the + * schema for this method to succeed. + * @return A <code>CreateCMSSignatureRequest</code> API object containing the + * data from the DOM element. * @throws MOAApplicationException An error occurred parsing the request. */ public CreateCMSSignatureRequest parse(Element requestElem) - throws MOAApplicationException { + throws MOAApplicationException { - List singleSignatureInfos = parseSingleSignatureInfos(requestElem); - String keyIdentifier = - XPathUtils.getElementValue(requestElem, KEY_IDENTIFIER_XPATH, null); + final List singleSignatureInfos = parseSingleSignatureInfos(requestElem); + final String keyIdentifier = + XPathUtils.getElementValue(requestElem, KEY_IDENTIFIER_XPATH, null); return factory.createCreateCMSSignatureRequest( - keyIdentifier, - singleSignatureInfos); + keyIdentifier, + singleSignatureInfos); } /** - * Parse all <code>SingleSignatureInfo</code> elements of the + * Parse all <code>SingleSignatureInfo</code> elements of the * <code>CreateCMSSignatureRequest</code>. - * + * * @param requestElem The <code>CreateCMSSignatureRequest</code> to parse. - * @return A <code>List</code> of <code>SingleSignatureInfo</code> API - * objects. - * @throws MOAApplicationException An error occurred parsing on of the - * <code>SingleSignatureInfo</code> elements. + * @return A <code>List</code> of <code>SingleSignatureInfo</code> API objects. + * @throws MOAApplicationException An error occurred parsing on of the + * <code>SingleSignatureInfo</code> elements. */ private List parseSingleSignatureInfos(Element requestElem) - throws MOAApplicationException { + throws MOAApplicationException { - List singleSignatureInfos = new ArrayList(); - NodeIterator sigInfoElems = - XPathUtils.selectNodeIterator(requestElem, SINGLE_SIGNATURE_INFO_XPATH); + final List singleSignatureInfos = new ArrayList(); + final NodeIterator sigInfoElems = + XPathUtils.selectNodeIterator(requestElem, SINGLE_SIGNATURE_INFO_XPATH); Element sigInfoElem; while ((sigInfoElem = (Element) sigInfoElems.nextNode()) != null) { @@ -137,132 +133,130 @@ public class CreateCMSSignatureRequestParser { /** * Parse a <code>SingleSignatureInfo</code> DOM element. - * - * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element to - * parse. - * @return A <code>SingleSignatureInfo</code> API object containing the - * information of <code>sigInfoElem</code>. - * @throws MOAApplicationException An error occurred parsing the - * <code>SingleSignatureInfo</code>. + * + * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element to parse. + * @return A <code>SingleSignatureInfo</code> API object containing the + * information of <code>sigInfoElem</code>. + * @throws MOAApplicationException An error occurred parsing the + * <code>SingleSignatureInfo</code>. */ private SingleSignatureInfo parseSingleSignatureInfo(Element sigInfoElem) - throws MOAApplicationException { + throws MOAApplicationException { - DataObjectInfo dataObjectInfo = parseDataObjectInfo(sigInfoElem); + final DataObjectInfo dataObjectInfo = parseDataObjectInfo(sigInfoElem); boolean securityLayerConform; boolean isPAdESSignature = false; if (sigInfoElem.hasAttribute(SL_CONFORM_ATTR_NAME)) { securityLayerConform = - BoolUtils.valueOf(sigInfoElem.getAttribute(SL_CONFORM_ATTR_NAME)); + BoolUtils.valueOf(sigInfoElem.getAttribute(SL_CONFORM_ATTR_NAME)); } else { securityLayerConform = true; } if (sigInfoElem.hasAttribute(IS_PADES_SIGNATURE_ATTR_NAME)) { - isPAdESSignature = BoolUtils.valueOf(sigInfoElem.getAttribute(IS_PADES_SIGNATURE_ATTR_NAME)); + isPAdESSignature = BoolUtils.valueOf(sigInfoElem.getAttribute(IS_PADES_SIGNATURE_ATTR_NAME)); } - + return factory.createSingleSignatureInfoCMS( - dataObjectInfo, - securityLayerConform, - isPAdESSignature); + dataObjectInfo, + securityLayerConform, + isPAdESSignature); } /** * Parse the <code>DataObjectInfo</code> DOM elements contained in the given * <code>SingleSignatureInfo</code> DOM element. - * - * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element - * whose <code>DataObjectInfo</code>s to parse. + * + * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element whose + * <code>DataObjectInfo</code>s to parse. * @return A <code>List</code> of <code>DataObjectInfo</code> API objects - * containing the data from the <code>DataObjectInfo</code> DOM elements. + * containing the data from the <code>DataObjectInfo</code> DOM + * elements. * @throws MOAApplicationException An error occurred parsing one of the - * <code>DataObjectInfo</code>s. + * <code>DataObjectInfo</code>s. */ private DataObjectInfo parseDataObjectInfo(Element sigInfoElem) - throws MOAApplicationException { - - Element dataObjInfoElem = (Element)XPathUtils.selectSingleNode(sigInfoElem, DATA_OBJECT_INFO_XPATH); - - String structure = dataObjInfoElem.getAttribute("Structure"); - Element dataObjectElem = - (Element) XPathUtils.selectSingleNode(dataObjInfoElem, DATA_OBJECT_XPATH); - - CMSDataObject dataObject = parseDataObject(dataObjectElem); - - return factory.createDataObjectInfo( - structure, - dataObject); - - } - - + throws MOAApplicationException { + + final Element dataObjInfoElem = (Element) XPathUtils.selectSingleNode(sigInfoElem, + DATA_OBJECT_INFO_XPATH); + + final String structure = dataObjInfoElem.getAttribute("Structure"); + final Element dataObjectElem = + (Element) XPathUtils.selectSingleNode(dataObjInfoElem, DATA_OBJECT_XPATH); - + final CMSDataObject dataObject = parseDataObject(dataObjectElem); + + return factory.createDataObjectInfo( + structure, + dataObject); + + } /** - * Parse a the <code>DataObject</code> DOM element contained in a given + * Parse a the <code>DataObject</code> DOM element contained in a given * <code>CreateCMSSignatureRequest</code> DOM element. - * - * @param requestElem The DataObject DOM element of the <code>VerifyCMSSignatureRequest</code> - * to parse. - * @return The <code>CMSDataObject</code> API object containing the data - * from the <code>DataObject</code> DOM element. + * + * @param requestElem The DataObject DOM element of the + * <code>VerifyCMSSignatureRequest</code> to parse. + * @return The <code>CMSDataObject</code> API object containing the data from + * the <code>DataObject</code> DOM element. */ private CMSDataObject parseDataObject(Element dataObjectElem) { if (dataObjectElem != null) { - Element metaInfoElem = (Element) XPathUtils.selectSingleNode(dataObjectElem, META_INFO_XPATH); + final Element metaInfoElem = (Element) XPathUtils.selectSingleNode(dataObjectElem, META_INFO_XPATH); MetaInfo metaInfo = null; - Element contentElem = (Element) XPathUtils.selectSingleNode(dataObjectElem, CONTENT_XPATH); - CMSContent content = parseContent(contentElem); + final Element contentElem = (Element) XPathUtils.selectSingleNode(dataObjectElem, CONTENT_XPATH); + final CMSContent content = parseContent(contentElem); if (metaInfoElem != null) { metaInfo = RequestParserUtils.parseMetaInfo(metaInfoElem); } - String excludeByteRangeFromStr = XPathUtils.getElementValue(dataObjectElem, EXCLUDEBYTERANGE_FROM_XPATH, null); - String excludeByteRangeToStr = XPathUtils.getElementValue(dataObjectElem, EXCLUDEBYTERANGE_TO_XPATH, null); - + final String excludeByteRangeFromStr = XPathUtils.getElementValue(dataObjectElem, + EXCLUDEBYTERANGE_FROM_XPATH, null); + final String excludeByteRangeToStr = XPathUtils.getElementValue(dataObjectElem, + EXCLUDEBYTERANGE_TO_XPATH, null); + BigDecimal excludeByteRangeFrom = null; BigDecimal excludeByteRangeTo = null; - - if (excludeByteRangeFromStr != null) - excludeByteRangeFrom = new BigDecimal(excludeByteRangeFromStr); - if (excludeByteRangeToStr != null) - excludeByteRangeTo = new BigDecimal(excludeByteRangeToStr); - + + if (excludeByteRangeFromStr != null) { + excludeByteRangeFrom = new BigDecimal(excludeByteRangeFromStr); + } + if (excludeByteRangeToStr != null) { + excludeByteRangeTo = new BigDecimal(excludeByteRangeToStr); + } + return factory.createCMSDataObject(metaInfo, content, excludeByteRangeFrom, excludeByteRangeTo); - } - else { + } else { return null; } } - - - /** - * Parse the content contained in a <code>CMSContentBaseType</code> kind of - * DOM element. - * - * @param contentElem The <code>CMSContentBaseType</code> kind of element to - * parse. - * @return A <code>CMSDataObject</code> API object containing the data - * from the given DOM element. - */ - private CMSContent parseContent(Element contentElem) { - Element base64ContentElem = + /** + * Parse the content contained in a <code>CMSContentBaseType</code> kind of DOM + * element. + * + * @param contentElem The <code>CMSContentBaseType</code> kind of element to + * parse. + * @return A <code>CMSDataObject</code> API object containing the data from the + * given DOM element. + */ + private CMSContent parseContent(Element contentElem) { + final Element base64ContentElem = (Element) XPathUtils.selectSingleNode(contentElem, BASE64_CONTENT_XPATH); - if (base64ContentElem != null) { - String base64Str = DOMUtils.getText(base64ContentElem); - InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); - return factory.createCMSContent(binaryContent); - } else { - return factory.createCMSContent( + if (base64ContentElem != null) { + final String base64Str = DOMUtils.getText(base64ContentElem); + final InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); + return factory.createCMSContent(binaryContent); + } else { + return factory.createCMSContent( contentElem.getAttribute("Reference")); - } - } + } + } }
\ No newline at end of file diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureResponseBuilder.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureResponseBuilder.java index 7ce0871..12b408b 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureResponseBuilder.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureResponseBuilder.java @@ -21,14 +21,10 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; -import java.io.IOException; import java.util.Iterator; -import javax.xml.transform.TransformerException; - import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -37,76 +33,71 @@ import at.gv.egovernment.moa.spss.api.cmssign.CMSSignatureResponse; import at.gv.egovernment.moa.spss.api.cmssign.CreateCMSSignatureResponse; import at.gv.egovernment.moa.spss.api.cmssign.CreateCMSSignatureResponseElement; import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; import at.gv.egovernment.moaspss.util.Constants; -import at.gv.egovernment.moaspss.util.DOMUtils; /** - * Convert a <code>CreateCMSSignatureResponse</code> API object into its - * XML representation, according to the MOA XML schema. - * + * Convert a <code>CreateCMSSignatureResponse</code> API object into its XML + * representation, according to the MOA XML schema. + * * @version $Id$ */ public class CreateCMSSignatureResponseBuilder { private static final String MOA_NS_URI = Constants.MOA_NS_URI; /** The XML document containing the response element. */ - private Document responseDoc; + private final Document responseDoc; /** The response <code>CreateCMSSignatureResponse</code> DOM element. */ - private Element responseElem; + private final Element responseElem; /** * Create a new <code>CreateCMSSignatureResponseBuilder</code>: - * - * @throws MOASystemException An error occurred setting up the resulting - * XML document. + * + * @throws MOASystemException An error occurred setting up the resulting XML + * document. */ public CreateCMSSignatureResponseBuilder() throws MOASystemException { responseDoc = - ResponseBuilderUtils.createResponse("CreateCMSSignatureResponse"); + ResponseBuilderUtils.createResponse("CreateCMSSignatureResponse"); responseElem = responseDoc.getDocumentElement(); } /** - * Build a document containing a <code>CreateCMSSignatureResponse</code> - * DOM element being the XML representation of the given + * Build a document containing a <code>CreateCMSSignatureResponse</code> DOM + * element being the XML representation of the given * <code>CreateCMSSignatureResponse</code> API object. - * - * @param response The <code>CreateCMSSignatureResponse</code> to convert - * to XML. - * @return A document containing the <code>CreateCMSSignatureResponse</code> - * DOM element. + * + * @param response The <code>CreateCMSSignatureResponse</code> to convert to + * XML. + * @return A document containing the <code>CreateCMSSignatureResponse</code> DOM + * element. */ public Document build(CreateCMSSignatureResponse response) { Iterator iter; - - - for (iter = response.getResponseElements().iterator(); iter.hasNext();) { - - Object responseObj = iter.next(); - - if (responseObj instanceof ErrorResponse) { - ErrorResponse errorResponse = (ErrorResponse) responseObj; - addErrorResponse(errorResponse); - - } else if (responseObj instanceof CreateCMSSignatureResponseElement) { - CMSSignatureResponse cmsSignatureResponse = (CMSSignatureResponse) responseObj; - addCMSSignature(cmsSignatureResponse); - - } - + + final Object responseObj = iter.next(); + + if (responseObj instanceof ErrorResponse) { + final ErrorResponse errorResponse = (ErrorResponse) responseObj; + addErrorResponse(errorResponse); + + } else if (responseObj instanceof CreateCMSSignatureResponseElement) { + final CMSSignatureResponse cmsSignatureResponse = (CMSSignatureResponse) responseObj; + addCMSSignature(cmsSignatureResponse); + + } + // CreateCMSSignatureResponseElement responseElement = // (CreateCMSSignatureResponseElement) iter.next(); -// +// // switch (responseElement.getResponseType()) { // case CreateCMSSignatureResponseElement.CMS_SIGNATURE : -// +// // break; // // case CreateCMSSignatureResponseElement.ERROR_RESPONSE : -// +// // break; // } @@ -115,37 +106,35 @@ public class CreateCMSSignatureResponseBuilder { return responseDoc; } - - /** * Add a <code>CMSSignature</code> element to the response. - * + * * @param cmsSignatureResponse The content to put under the - * <code>CMSSignature</code> element. + * <code>CMSSignature</code> element. */ private void addCMSSignature(CMSSignatureResponse cmsSignatureResponse) { - String base64Value = cmsSignatureResponse.getCMSSignature(); - - Element cmsSignature = responseDoc.createElementNS(MOA_NS_URI, "CMSSignature"); - cmsSignature.setTextContent(base64Value); - - responseElem.appendChild(cmsSignature); - -} - + final String base64Value = cmsSignatureResponse.getCMSSignature(); + + final Element cmsSignature = responseDoc.createElementNS(MOA_NS_URI, "CMSSignature"); + cmsSignature.setTextContent(base64Value); + + responseElem.appendChild(cmsSignature); + + } + /** * Add a <code>ErrorResponse</code> element to the response. - * + * * @param errorResponse The API object containing the information to put into - * the <code>ErrorResponse</code> DOM element. + * the <code>ErrorResponse</code> DOM element. */ private void addErrorResponse(ErrorResponse errorResponse) { - Element errorElem = - responseDoc.createElementNS(MOA_NS_URI, "ErrorResponse"); - Element errorCodeElem = - responseDoc.createElementNS(MOA_NS_URI, "ErrorCode"); - Element infoElem = responseDoc.createElementNS(MOA_NS_URI, "Info"); - String errorCodeStr = Integer.toString(errorResponse.getErrorCode()); + final Element errorElem = + responseDoc.createElementNS(MOA_NS_URI, "ErrorResponse"); + final Element errorCodeElem = + responseDoc.createElementNS(MOA_NS_URI, "ErrorCode"); + final Element infoElem = responseDoc.createElementNS(MOA_NS_URI, "Info"); + final String errorCodeStr = Integer.toString(errorResponse.getErrorCode()); errorCodeElem.appendChild(responseDoc.createTextNode(errorCodeStr)); errorElem.appendChild(errorCodeElem); diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java index d677f88..8898aaf 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.util.ArrayList; @@ -47,7 +46,7 @@ import at.gv.egovernment.moaspss.util.XPathUtils; /** * A parser to parse <code>CreateXMLSignatureRequest</code> DOM trees into * <code>CreateXMLSignatureRequest</code> API objects. - * + * * @author Patrick Peck * @version $Id$ */ @@ -58,25 +57,25 @@ public class CreateXMLSignatureRequestParser { // private static final String MOA = Constants.MOA_PREFIX + ":"; private static final String KEY_IDENTIFIER_XPATH = - "/" + MOA + "CreateXMLSignatureRequest/" + MOA + "KeyIdentifier"; + "/" + MOA + "CreateXMLSignatureRequest/" + MOA + "KeyIdentifier"; private static final String SINGLE_SIGNATURE_INFO_XPATH = - "/" + MOA + "CreateXMLSignatureRequest/" + MOA + "SingleSignatureInfo"; + "/" + MOA + "CreateXMLSignatureRequest/" + MOA + "SingleSignatureInfo"; private static final String DATA_OBJECT_INFO_XPATH = MOA + "DataObjectInfo"; private static final String DATA_OBJECT_XPATH = MOA + "DataObject"; private static final String CREATE_SIGNATURE_INFO_XPATH = - MOA + "CreateSignatureInfo"; + MOA + "CreateSignatureInfo"; private static final String CREATE_TRANSFORMS_INFO_PROFILE_XPATH = - (MOA + "CreateTransformsInfoProfile | ") - + (MOA + "CreateTransformsInfoProfileID"); + MOA + "CreateTransformsInfoProfile | " + + MOA + "CreateTransformsInfoProfileID"; private static final String CREATE_SIGNATURE_ENVIRONMENT_XPATH = - MOA + "CreateSignatureEnvironment"; + MOA + "CreateSignatureEnvironment"; private static final String CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH = - (MOA + "CreateSignatureEnvironmentProfile | ") - + (MOA + "CreateSignatureEnvironmentProfileID"); + MOA + "CreateSignatureEnvironmentProfile | " + + MOA + "CreateSignatureEnvironmentProfileID"; private static final String SL_CONFORM_ATTR_NAME = "SecurityLayerConformity"; - + /** The factory to create API objects. */ - private SPSSFactory factory; + private final SPSSFactory factory; /** * Create a new <code>CreateXMLSignatureRequestParser</code>. @@ -86,44 +85,43 @@ public class CreateXMLSignatureRequestParser { } /** - * Parse a <code>CreateXMLSignatureRequest</code> DOM element, as defined - * by the MOA schema. - * + * Parse a <code>CreateXMLSignatureRequest</code> DOM element, as defined by the + * MOA schema. + * * @param requestElem The <code>CreateXMLSignatureRequest</code> to parse. The - * request must have been successfully parsed against the schema for this - * method to succeed. - * @return A <code>CreateXMLSignatureRequest</code> API object containing - * the data from the DOM element. + * request must have been successfully parsed against the + * schema for this method to succeed. + * @return A <code>CreateXMLSignatureRequest</code> API object containing the + * data from the DOM element. * @throws MOAApplicationException An error occurred parsing the request. */ public CreateXMLSignatureRequest parse(Element requestElem) - throws MOAApplicationException { + throws MOAApplicationException { - List singleSignatureInfos = parseSingleSignatureInfos(requestElem); - String keyIdentifier = - XPathUtils.getElementValue(requestElem, KEY_IDENTIFIER_XPATH, null); + final List singleSignatureInfos = parseSingleSignatureInfos(requestElem); + final String keyIdentifier = + XPathUtils.getElementValue(requestElem, KEY_IDENTIFIER_XPATH, null); return factory.createCreateXMLSignatureRequest( - keyIdentifier, - singleSignatureInfos); + keyIdentifier, + singleSignatureInfos); } /** - * Parse all <code>SingleSignatureInfo</code> elements of the + * Parse all <code>SingleSignatureInfo</code> elements of the * <code>CreateXMLSignatureRequest</code>. - * + * * @param requestElem The <code>CreateXMLSignatureRequest</code> to parse. - * @return A <code>List</code> of <code>SingleSignatureInfo</code> API - * objects. - * @throws MOAApplicationException An error occurred parsing on of the - * <code>SingleSignatureInfo</code> elements. + * @return A <code>List</code> of <code>SingleSignatureInfo</code> API objects. + * @throws MOAApplicationException An error occurred parsing on of the + * <code>SingleSignatureInfo</code> elements. */ private List parseSingleSignatureInfos(Element requestElem) - throws MOAApplicationException { + throws MOAApplicationException { - List singleSignatureInfos = new ArrayList(); - NodeIterator sigInfoElems = - XPathUtils.selectNodeIterator(requestElem, SINGLE_SIGNATURE_INFO_XPATH); + final List singleSignatureInfos = new ArrayList(); + final NodeIterator sigInfoElems = + XPathUtils.selectNodeIterator(requestElem, SINGLE_SIGNATURE_INFO_XPATH); Element sigInfoElem; while ((sigInfoElem = (Element) sigInfoElems.nextNode()) != null) { @@ -135,52 +133,52 @@ public class CreateXMLSignatureRequestParser { /** * Parse a <code>SingleSignatureInfo</code> DOM element. - * - * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element to - * parse. - * @return A <code>SingleSignatureInfo</code> API object containing the - * information of <code>sigInfoElem</code>. - * @throws MOAApplicationException An error occurred parsing the - * <code>SingleSignatureInfo</code>. + * + * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element to parse. + * @return A <code>SingleSignatureInfo</code> API object containing the + * information of <code>sigInfoElem</code>. + * @throws MOAApplicationException An error occurred parsing the + * <code>SingleSignatureInfo</code>. */ private SingleSignatureInfo parseSingleSignatureInfo(Element sigInfoElem) - throws MOAApplicationException { + throws MOAApplicationException { - List dataObjectInfos = parseDataObjectInfos(sigInfoElem); - CreateSignatureInfo createSignatureInfo = - parseCreateSignatureInfo(sigInfoElem); + final List dataObjectInfos = parseDataObjectInfos(sigInfoElem); + final CreateSignatureInfo createSignatureInfo = + parseCreateSignatureInfo(sigInfoElem); boolean securityLayerConform; if (sigInfoElem.hasAttribute(SL_CONFORM_ATTR_NAME)) { securityLayerConform = - BoolUtils.valueOf(sigInfoElem.getAttribute(SL_CONFORM_ATTR_NAME)); + BoolUtils.valueOf(sigInfoElem.getAttribute(SL_CONFORM_ATTR_NAME)); } else { securityLayerConform = true; } return factory.createSingleSignatureInfo( - dataObjectInfos, - createSignatureInfo, - securityLayerConform); + dataObjectInfos, + createSignatureInfo, + securityLayerConform); } /** * Parse the <code>DataObjectInfo</code> DOM elements contained in the given * <code>SingleSignatureInfo</code> DOM element. - * - * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element - * whose <code>DataObjectInfo</code>s to parse. + * + * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element whose + * <code>DataObjectInfo</code>s to parse. * @return A <code>List</code> of <code>DataObjectInfo</code> API objects - * containing the data from the <code>DataObjectInfo</code> DOM elements. + * containing the data from the <code>DataObjectInfo</code> DOM + * elements. * @throws MOAApplicationException An error occurred parsing one of the - * <code>DataObjectInfo</code>s. + * <code>DataObjectInfo</code>s. */ private List parseDataObjectInfos(Element sigInfoElem) - throws MOAApplicationException { + throws MOAApplicationException { - List dataObjectInfos = new ArrayList(); - NodeIterator dataObjInfoElems = - XPathUtils.selectNodeIterator(sigInfoElem, DATA_OBJECT_INFO_XPATH); + final List dataObjectInfos = new ArrayList(); + final NodeIterator dataObjInfoElems = + XPathUtils.selectNodeIterator(sigInfoElem, DATA_OBJECT_INFO_XPATH); Element dataObjInfoElem; while ((dataObjInfoElem = (Element) dataObjInfoElems.nextNode()) != null) { @@ -191,91 +189,91 @@ public class CreateXMLSignatureRequestParser { /** * Parse a <code>DataObjectInfo</code> DOM element. - * - * @param dataObjInfoElem The <code>DataObjectInfo</code> DOM element to - * parse. - * @return A <code>DataObjectInfo</code> API element containing the data - * from <code>dataObjInfoElem</code>. + * + * @param dataObjInfoElem The <code>DataObjectInfo</code> DOM element to parse. + * @return A <code>DataObjectInfo</code> API element containing the data from + * <code>dataObjInfoElem</code>. * @throws MOAApplicationException An error occurred parsing the - * <code>DataObjectInfo</code>. + * <code>DataObjectInfo</code>. */ private DataObjectInfo parseDataObjectInfo(Element dataObjInfoElem) - throws MOAApplicationException { - - String structure = dataObjInfoElem.getAttribute("Structure"); - Element dataObjectElem = - (Element) XPathUtils.selectSingleNode(dataObjInfoElem, DATA_OBJECT_XPATH); - Content dataObject = RequestParserUtils.parseContent(dataObjectElem); - CreateTransformsInfoProfile createTransformsInfoProfile = - parseCreateTransformsInfoProfile(dataObjInfoElem); + throws MOAApplicationException { + + final String structure = dataObjInfoElem.getAttribute("Structure"); + final Element dataObjectElem = + (Element) XPathUtils.selectSingleNode(dataObjInfoElem, DATA_OBJECT_XPATH); + final Content dataObject = RequestParserUtils.parseContent(dataObjectElem); + final CreateTransformsInfoProfile createTransformsInfoProfile = + parseCreateTransformsInfoProfile(dataObjInfoElem); boolean childOfManifest; if (dataObjInfoElem.hasAttribute("ChildOfManifest")) { childOfManifest = - BoolUtils.valueOf(dataObjInfoElem.getAttribute("ChildOfManifest")); + BoolUtils.valueOf(dataObjInfoElem.getAttribute("ChildOfManifest")); } else { childOfManifest = false; } return factory.createDataObjectInfo( - structure, - childOfManifest, - dataObject, - createTransformsInfoProfile); + structure, + childOfManifest, + dataObject, + createTransformsInfoProfile); } /** * Parse a <code>CreateTransformsInfoProfile</code> DOM element. - * - * @param dataObjInfoElem The <code>DataObjectInfo</code> DOM element - * containing the <code>CreateTransformsInfoProfile</code>. + * + * @param dataObjInfoElem The <code>DataObjectInfo</code> DOM element containing + * the <code>CreateTransformsInfoProfile</code>. * @return The <code>CreateTransformsInfoProfile</code> API object containing - * the profile found in <code>dataObjInfoElem</code>. - * @throws MOAApplicationException An error occurred parsing the - * <code>CreateTransformsInfoProfile</code>. + * the profile found in <code>dataObjInfoElem</code>. + * @throws MOAApplicationException An error occurred parsing the + * <code>CreateTransformsInfoProfile</code>. */ private CreateTransformsInfoProfile parseCreateTransformsInfoProfile(Element dataObjInfoElem) - throws MOAApplicationException { + throws MOAApplicationException { - Element profileElem = - (Element) XPathUtils.selectSingleNode( - dataObjInfoElem, - CREATE_TRANSFORMS_INFO_PROFILE_XPATH); + final Element profileElem = + (Element) XPathUtils.selectSingleNode( + dataObjInfoElem, + CREATE_TRANSFORMS_INFO_PROFILE_XPATH); if ("CreateTransformsInfoProfile".equals(profileElem.getLocalName())) { - ProfileParser profileParser = new ProfileParser(); + final ProfileParser profileParser = new ProfileParser(); return profileParser.parseCreateTransformsInfoProfile(profileElem); } else { - String profileID = DOMUtils.getText(profileElem); + final String profileID = DOMUtils.getText(profileElem); return factory.createCreateTransformsInfoProfile(profileID); } } /** - * Parse the <code>CreateSignatureInfo</code> DOM element contained in - * a <code>SingleSignatureInfo</code>. - * + * Parse the <code>CreateSignatureInfo</code> DOM element contained in a + * <code>SingleSignatureInfo</code>. + * * @param sigInfoElem The <code>SingleSignatureInfo</code> DOM element - * containing the <code>CreateSignatureInfo</code> to be parsed. - * @return A <code>CreateSignatureInfo</code> API object containing the - * data from the <code>CreateSignatureInfo</code> DOM element, or - * <code>null</code>, if none was found. + * containing the <code>CreateSignatureInfo</code> to be + * parsed. + * @return A <code>CreateSignatureInfo</code> API object containing the data + * from the <code>CreateSignatureInfo</code> DOM element, or + * <code>null</code>, if none was found. */ private CreateSignatureInfo parseCreateSignatureInfo(Element sigInfoElem) { - Element createInfoElem = - (Element) XPathUtils.selectSingleNode( - sigInfoElem, - CREATE_SIGNATURE_INFO_XPATH); + final Element createInfoElem = + (Element) XPathUtils.selectSingleNode( + sigInfoElem, + CREATE_SIGNATURE_INFO_XPATH); if (createInfoElem != null) { - Element environmentElem = - (Element) XPathUtils.selectSingleNode( - createInfoElem, - CREATE_SIGNATURE_ENVIRONMENT_XPATH); - Content environment = RequestParserUtils.parseContent(environmentElem); - CreateSignatureEnvironmentProfile environmentProfile = - parseCreateSignatureEnvironmentProfile(createInfoElem); + final Element environmentElem = + (Element) XPathUtils.selectSingleNode( + createInfoElem, + CREATE_SIGNATURE_ENVIRONMENT_XPATH); + final Content environment = RequestParserUtils.parseContent(environmentElem); + final CreateSignatureEnvironmentProfile environmentProfile = + parseCreateSignatureEnvironmentProfile(createInfoElem); return factory.createCreateSignatureInfo(environment, environmentProfile); } else { @@ -284,26 +282,25 @@ public class CreateXMLSignatureRequestParser { } /** - * Parse the <code>CreateSignatureEnvironmentProfile</code> contained in - * the given <code>CreateSignatureInfo</code> DOM element. - * - * @param createInfoElem <code>CreateSignatureInfo</code> DOM element to - * parse. - * @return The <code>CreateSignatureEnvironmentProfile</code> contained - * in the given <code>CreateSignatureInfo</code> DOM element.. + * Parse the <code>CreateSignatureEnvironmentProfile</code> contained in the + * given <code>CreateSignatureInfo</code> DOM element. + * + * @param createInfoElem <code>CreateSignatureInfo</code> DOM element to parse. + * @return The <code>CreateSignatureEnvironmentProfile</code> contained in the + * given <code>CreateSignatureInfo</code> DOM element.. */ private CreateSignatureEnvironmentProfile parseCreateSignatureEnvironmentProfile(Element createInfoElem) { - Element profileElem = - (Element) XPathUtils.selectSingleNode( - createInfoElem, - CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH); + final Element profileElem = + (Element) XPathUtils.selectSingleNode( + createInfoElem, + CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH); if ("CreateSignatureEnvironmentProfile" - .equals(profileElem.getLocalName())) { - ProfileParser profileParser = new ProfileParser(); + .equals(profileElem.getLocalName())) { + final ProfileParser profileParser = new ProfileParser(); return profileParser.parseCreateSignatureEnvironmentProfile(profileElem); } else { - String profileID = DOMUtils.getText(profileElem); + final String profileID = DOMUtils.getText(profileElem); return factory.createCreateSignatureEnvironmentProfile(profileID); } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java index 3c93fce..d6af889 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.util.Iterator; @@ -38,9 +37,9 @@ import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; import at.gv.egovernment.moaspss.util.Constants; /** - * Convert a <code>CreateXMLSignatureResponse</code> API object into its - * XML representation, according to the MOA XML schema. - * + * Convert a <code>CreateXMLSignatureResponse</code> API object into its XML + * representation, according to the MOA XML schema. + * * @author Patrick Peck * @version $Id$ */ @@ -48,48 +47,48 @@ public class CreateXMLSignatureResponseBuilder { private static final String MOA_NS_URI = Constants.MOA_NS_URI; /** The XML document containing the response element. */ - private Document responseDoc; + private final Document responseDoc; /** The response <code>CreateXMLSignatureResponse</code> DOM element. */ - private Element responseElem; + private final Element responseElem; /** * Create a new <code>CreateXMLSignatureResponseBuilder</code>: - * - * @throws MOASystemException An error occurred setting up the resulting - * XML document. + * + * @throws MOASystemException An error occurred setting up the resulting XML + * document. */ public CreateXMLSignatureResponseBuilder() throws MOASystemException { responseDoc = - ResponseBuilderUtils.createResponse("CreateXMLSignatureResponse"); + ResponseBuilderUtils.createResponse("CreateXMLSignatureResponse"); responseElem = responseDoc.getDocumentElement(); } /** - * Build a document containing a <code>CreateXMLSignatureResponse</code> - * DOM element being the XML representation of the given + * Build a document containing a <code>CreateXMLSignatureResponse</code> DOM + * element being the XML representation of the given * <code>CreateXMLSignatureResponse</code> API object. - * - * @param response The <code>CreateXMLSignatureResponse</code> to convert - * to XML. - * @return A document containing the <code>CreateXMLSignatureResponse</code> - * DOM element. + * + * @param response The <code>CreateXMLSignatureResponse</code> to convert to + * XML. + * @return A document containing the <code>CreateXMLSignatureResponse</code> DOM + * element. */ public Document build(CreateXMLSignatureResponse response) { Iterator iter; for (iter = response.getResponseElements().iterator(); iter.hasNext();) { - CreateXMLSignatureResponseElement responseElement = - (CreateXMLSignatureResponseElement) iter.next(); + final CreateXMLSignatureResponseElement responseElement = + (CreateXMLSignatureResponseElement) iter.next(); switch (responseElement.getResponseType()) { - case CreateXMLSignatureResponseElement.SIGNATURE_ENVIRONMENT_RESPONSE : - SignatureEnvironmentResponse envResponse = - (SignatureEnvironmentResponse) responseElement; + case CreateXMLSignatureResponseElement.SIGNATURE_ENVIRONMENT_RESPONSE: + final SignatureEnvironmentResponse envResponse = + (SignatureEnvironmentResponse) responseElement; addSignatureEnvironment(envResponse); break; - case CreateXMLSignatureResponseElement.ERROR_RESPONSE : - ErrorResponse errorResponse = (ErrorResponse) responseElement; + case CreateXMLSignatureResponseElement.ERROR_RESPONSE: + final ErrorResponse errorResponse = (ErrorResponse) responseElement; addErrorResponse(errorResponse); break; } @@ -101,35 +100,36 @@ public class CreateXMLSignatureResponseBuilder { /** * Add a <code>SignatureEnvironment</code> element to the response. - * + * * @param envResponse The content to put under the - * <code>SignatureEnvironment</code> element. This should either be a - * <code>dsig:Signature</code> element (in case of a detached signature) or - * the signature environment containing the signature (in case of - * an enveloping signature). + * <code>SignatureEnvironment</code> element. This should + * either be a <code>dsig:Signature</code> element (in case + * of a detached signature) or the signature environment + * containing the signature (in case of an enveloping + * signature). */ private void addSignatureEnvironment(SignatureEnvironmentResponse envResponse) { - Element content = envResponse.getSignatureEnvironment(); - Node importedSignature = responseDoc.importNode(content, true); - Element signatureEnvironment = - responseDoc.createElementNS(MOA_NS_URI, "SignatureEnvironment"); + final Element content = envResponse.getSignatureEnvironment(); + final Node importedSignature = responseDoc.importNode(content, true); + final Element signatureEnvironment = + responseDoc.createElementNS(MOA_NS_URI, "SignatureEnvironment"); signatureEnvironment.appendChild(importedSignature); responseElem.appendChild(signatureEnvironment); } /** * Add a <code>ErrorResponse</code> element to the response. - * + * * @param errorResponse The API object containing the information to put into - * the <code>ErrorResponse</code> DOM element. + * the <code>ErrorResponse</code> DOM element. */ private void addErrorResponse(ErrorResponse errorResponse) { - Element errorElem = - responseDoc.createElementNS(MOA_NS_URI, "ErrorResponse"); - Element errorCodeElem = - responseDoc.createElementNS(MOA_NS_URI, "ErrorCode"); - Element infoElem = responseDoc.createElementNS(MOA_NS_URI, "Info"); - String errorCodeStr = Integer.toString(errorResponse.getErrorCode()); + final Element errorElem = + responseDoc.createElementNS(MOA_NS_URI, "ErrorResponse"); + final Element errorCodeElem = + responseDoc.createElementNS(MOA_NS_URI, "ErrorCode"); + final Element infoElem = responseDoc.createElementNS(MOA_NS_URI, "Info"); + final String errorCodeStr = Integer.toString(errorResponse.getErrorCode()); errorCodeElem.appendChild(responseDoc.createTextNode(errorCodeStr)); errorElem.appendChild(errorCodeElem); diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java index 6b34922..b8cb361 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.io.IOException; @@ -52,85 +51,86 @@ import at.gv.egovernment.moaspss.util.XPathUtils; /** * Parse the various profile elements contained in the MOA web service requests * and given as separate files in the MOA configuration. - * + * * The profiles parsed must be schema valid according to the MOA XML schema. - * + * * @author Patrick Peck * @version $Id$ */ public class ProfileParser { - + // // XPath expressions to select parts of the profiles // private static final String MOA = Constants.MOA_PREFIX + ":"; private static final String DSIG = Constants.DSIG_PREFIX + ":"; private static final String CREATE_TRANSFORMS_XPATH = - MOA + "CreateTransformsInfo/" + DSIG + "Transforms"; + MOA + "CreateTransformsInfo/" + DSIG + "Transforms"; private static final String FINAL_DATA_META_INFO_XPATH = - MOA + "CreateTransformsInfo/" + MOA + "FinalDataMetaInfo"; + MOA + "CreateTransformsInfo/" + MOA + "FinalDataMetaInfo"; private static final String CREATE_SIGNATURE_LOCATION_XPATH = - MOA + "CreateSignatureLocation"; + MOA + "CreateSignatureLocation"; private static final String SUPPLEMENT_XPATH = MOA + "Supplement"; private static final String VERIFY_TRANSFORMS_XPATH = DSIG + "Transforms"; private static final String TRANSFORM_PARAMETER_XPATH = - MOA + "TransformParameter"; + MOA + "TransformParameter"; private static final String TRANSFORM_PARAMETER_CONTENT_XPATH = - MOA + "Base64Content | " + MOA + "Hash"; + MOA + "Base64Content | " + MOA + "Hash"; private static final String DIGEST_METHOD_XPATH = DSIG + "DigestMethod"; private static final String DIGEST_VALUE_XPATH = DSIG + "DigestValue"; /** The factory used to create API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); + private final SPSSFactory factory = SPSSFactory.getInstance(); /** * Parse a <code>CreateTransformsInfoProfile</code> DOM element. - * - * @param profileElem The <code>CreateTransformsInfoProfile</code> element - * to parse. + * + * @param profileElem The <code>CreateTransformsInfoProfile</code> element to + * parse. * @return The <code>CreateTransformsInfoProfile</code> API object containing - * the data from the <code>profileElem</code>. - * @throws MOAApplicationException An error occurred parsing the DOM element. + * the data from the <code>profileElem</code>. + * @throws MOAApplicationException An error occurred parsing the DOM element. */ public CreateTransformsInfoProfile parseCreateTransformsInfoProfile(Element profileElem) - throws MOAApplicationException { - CreateTransformsInfo createTransformsInfo = - parseCreateTransformsInfo(profileElem); - List supplements = parseSupplements(profileElem); + throws MOAApplicationException { + final CreateTransformsInfo createTransformsInfo = + parseCreateTransformsInfo(profileElem); + final List supplements = parseSupplements(profileElem); return factory.createCreateTransformsInfoProfile( - createTransformsInfo, - supplements); + createTransformsInfo, + supplements); } /** - * Parse the <code>CreateTransformsInfo</code> DOM element contained in a + * Parse the <code>CreateTransformsInfo</code> DOM element contained in a * <code>CreateTransformsInfoProfile</code>. - * - * @param profileElem The <code>CreateTransformsInfoProfile</code> DOM - * element containing the <code>CreateTransformsInfo</code>. - * @return The <code>CreateTransformsInfo</code> API object containinig the - * data from the <code>CreateTransformsInfo</code> DOM element. + * + * @param profileElem The <code>CreateTransformsInfoProfile</code> DOM element + * containing the <code>CreateTransformsInfo</code>. + * @return The <code>CreateTransformsInfo</code> API object containinig the data + * from the <code>CreateTransformsInfo</code> DOM element. * @throws MOAApplicationException An error occurred parsing the - * <code>CreateTransformsInfo</code> DOM element. + * <code>CreateTransformsInfo</code> DOM + * element. */ private CreateTransformsInfo parseCreateTransformsInfo(Element profileElem) - throws MOAApplicationException { + throws MOAApplicationException { - Element transformsElem = - (Element) XPathUtils.selectSingleNode( - profileElem, - CREATE_TRANSFORMS_XPATH); - Element metaInfoElem = - (Element) XPathUtils.selectSingleNode( - profileElem, - FINAL_DATA_META_INFO_XPATH); + final Element transformsElem = + (Element) XPathUtils.selectSingleNode( + profileElem, + CREATE_TRANSFORMS_XPATH); + final Element metaInfoElem = + (Element) XPathUtils.selectSingleNode( + profileElem, + FINAL_DATA_META_INFO_XPATH); MetaInfo finalDataMetaInfo; List transforms; - // parse the dsig:Transforms + // parse the dsig:Transforms if (transformsElem != null) { - TransformParser transformsParser = new TransformParser(); + final TransformParser transformsParser = new TransformParser(); transforms = transformsParser.parseTransforms(transformsElem); } else { transforms = null; @@ -144,65 +144,66 @@ public class ProfileParser { /** * Parse a <code>CreateSignatureEnvironmentProfile</code> DOM element. - * - * @param profileElem The <code>CreateSignatureEnvironmentProfile</code> - * DOM element to parse. + * + * @param profileElem The <code>CreateSignatureEnvironmentProfile</code> DOM + * element to parse. * @return The <code>CreateSignatureEnvironmentProfile</code> API object - * containing the data from the <code>profileElem</code>. + * containing the data from the <code>profileElem</code>. */ public CreateSignatureEnvironmentProfile parseCreateSignatureEnvironmentProfile(Element profileElem) { - CreateSignatureLocation createSignatureLocation = - parseCreateSignatureLocation(profileElem); - List supplements = parseSupplements(profileElem); + final CreateSignatureLocation createSignatureLocation = + parseCreateSignatureLocation(profileElem); + final List supplements = parseSupplements(profileElem); return factory.createCreateSignatureEnvironmentProfile( - createSignatureLocation, - supplements); + createSignatureLocation, + supplements); } /** - * Parse a <code>CreateSignatureLocation</code> DOM element contained in - * a <code>CreateSignatureEnvironmentProfile</code>. - * + * Parse a <code>CreateSignatureLocation</code> DOM element contained in a + * <code>CreateSignatureEnvironmentProfile</code>. + * * @param profileElem The <code>CreateSignatureEnvironmentProfile</code> DOM - * element containing the <code>CreateSignatureLocation</code>. - * @return The <code>CreateSignatureLocation</code> API object containing - * the data from the <code>CreateSignatureLocation</code> DOM element. + * element containing the + * <code>CreateSignatureLocation</code>. + * @return The <code>CreateSignatureLocation</code> API object containing the + * data from the <code>CreateSignatureLocation</code> DOM element. */ private CreateSignatureLocation parseCreateSignatureLocation(Element profileElem) { - Element locationElem = - (Element) XPathUtils.selectSingleNode( - profileElem, - CREATE_SIGNATURE_LOCATION_XPATH); - String xPathExpression = DOMUtils.getText(locationElem); - Map namespaceDeclarations = DOMUtils.getNamespaceDeclarations(locationElem); - String indexStr = locationElem.getAttribute("Index"); - int index = Integer.parseInt(indexStr); + final Element locationElem = + (Element) XPathUtils.selectSingleNode( + profileElem, + CREATE_SIGNATURE_LOCATION_XPATH); + final String xPathExpression = DOMUtils.getText(locationElem); + final Map namespaceDeclarations = DOMUtils.getNamespaceDeclarations(locationElem); + final String indexStr = locationElem.getAttribute("Index"); + final int index = Integer.parseInt(indexStr); return factory.createCreateSignatureLocation( - xPathExpression, - index, - namespaceDeclarations); + xPathExpression, + index, + namespaceDeclarations); } /** - * Parse all <code>Supplement</code> DOM elements contained in a given - * parent DOM element. - * + * Parse all <code>Supplement</code> DOM elements contained in a given parent + * DOM element. + * * @param supplementsParentElem The DOM element being the parent of the - * <code>Supplement</code>s. - * @return A <code>List</code> of <code>Supplement</code> API objects - * containing the data from the <code>Supplement</code> DOM elements. + * <code>Supplement</code>s. + * @return A <code>List</code> of <code>Supplement</code> API objects containing + * the data from the <code>Supplement</code> DOM elements. */ private List parseSupplements(Element supplementsParentElem) { - List supplements = new ArrayList(); - NodeIterator supplementElems = - XPathUtils.selectNodeIterator(supplementsParentElem, SUPPLEMENT_XPATH); + final List supplements = new ArrayList(); + final NodeIterator supplementElems = + XPathUtils.selectNodeIterator(supplementsParentElem, SUPPLEMENT_XPATH); Element supplementElem; while ((supplementElem = (Element) supplementElems.nextNode()) != null) { - XMLDataObjectAssociation supplement = - RequestParserUtils.parseXMLDataObjectAssociation(supplementElem); + final XMLDataObjectAssociation supplement = + RequestParserUtils.parseXMLDataObjectAssociation(supplementElem); supplements.add(supplement); } return supplements; @@ -210,44 +211,44 @@ public class ProfileParser { /** * Parse a <code>SupplementProfile</code> DOM element. - * + * * @param profileElem The <code>SupplementProfile</code> DOM element to parse. - * @return The <code>SupplementProfile</code> API object containing the - * data from the <code>SupplementProfile</code> DOM element. + * @return The <code>SupplementProfile</code> API object containing the data + * from the <code>SupplementProfile</code> DOM element. */ public SupplementProfile parseSupplementProfile(Element profileElem) { - XMLDataObjectAssociation supplementProfile = - RequestParserUtils.parseXMLDataObjectAssociation(profileElem); + final XMLDataObjectAssociation supplementProfile = + RequestParserUtils.parseXMLDataObjectAssociation(profileElem); return factory.createSupplementProfile(supplementProfile); } /** - * Parse a <code>VerifyTransformsInfoProfile</code> DOM element. - * - * @param profileElem The <code>VerifyTransformsInfoProfile</code> DOM - * element to parse. - * @return A <code>VerifyTransformsInfoProfile</code> API object containing - * the information from the <code>VerifyTransformsInfoProfile</code> DOM - * element. + * Parse a <code>VerifyTransformsInfoProfile</code> DOM element. + * + * @param profileElem The <code>VerifyTransformsInfoProfile</code> DOM element + * to parse. + * @return A <code>VerifyTransformsInfoProfile</code> API object containing the + * information from the <code>VerifyTransformsInfoProfile</code> DOM + * element. * @throws MOAApplicationException An error occurred parsing the - * <code>VerifyTransformsInfoProfile</code>. + * <code>VerifyTransformsInfoProfile</code>. */ public VerifyTransformsInfoProfile parseVerifyTransformsInfoProfile(Element profileElem) - throws MOAApplicationException { - Element transformsElem = - (Element) XPathUtils.selectSingleNode( - profileElem, - VERIFY_TRANSFORMS_XPATH); + throws MOAApplicationException { + final Element transformsElem = + (Element) XPathUtils.selectSingleNode( + profileElem, + VERIFY_TRANSFORMS_XPATH); List transforms = null; - NodeIterator paramElems = - XPathUtils.selectNodeIterator(profileElem, TRANSFORM_PARAMETER_XPATH); + final NodeIterator paramElems = + XPathUtils.selectNodeIterator(profileElem, TRANSFORM_PARAMETER_XPATH); Element paramElem; - List transformParameters = new ArrayList(); + final List transformParameters = new ArrayList(); // parse the dsig:Transforms if (transformsElem != null) { - TransformParser transformsParser = new TransformParser(); + final TransformParser transformsParser = new TransformParser(); transforms = transformsParser.parseTransforms(transformsElem); } @@ -257,51 +258,50 @@ public class ProfileParser { } return factory.createVerifyTransformsInfoProfile( - transforms, - transformParameters); + transforms, + transformParameters); } /** * Parse a <code>TransformParameter</code> DOM element. - * - * @param paramElem The <code>TransformParameter</code> DOM element to - * parse. + * + * @param paramElem The <code>TransformParameter</code> DOM element to parse. * @return The <code>TransformParameter</code> API object containing the - * information from the <code>TransformParameter</code> DOM element. + * information from the <code>TransformParameter</code> DOM element. * @throws MOAApplicationException An error occurred parsing the - * <code>TransformParameter</code> DOM element. + * <code>TransformParameter</code> DOM element. */ - private TransformParameter parseTransformParameter(Element paramElem) - throws MOAApplicationException { - String uri = paramElem.getAttribute("URI"); - Element contentElem = - (Element) XPathUtils.selectSingleNode( - paramElem, - TRANSFORM_PARAMETER_CONTENT_XPATH); + private TransformParameter parseTransformParameter(Element paramElem) + throws MOAApplicationException { + final String uri = paramElem.getAttribute("URI"); + final Element contentElem = + (Element) XPathUtils.selectSingleNode( + paramElem, + TRANSFORM_PARAMETER_CONTENT_XPATH); if (contentElem == null) { return factory.createTransformParameter(uri); } else if ("Base64Content".equals(contentElem.getLocalName())) { - String base64Str = DOMUtils.getText(contentElem); - InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); + final String base64Str = DOMUtils.getText(contentElem); + final InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); return factory.createTransformParameter(uri, binaryContent); } else { // "Hash".equals(contentElem.getLocalName()) - String digestMethodStr = - XPathUtils.getElementValue(contentElem, DIGEST_METHOD_XPATH, ""); - String digestValueStr = - XPathUtils.getElementValue(contentElem, DIGEST_VALUE_XPATH, ""); + final String digestMethodStr = + XPathUtils.getElementValue(contentElem, DIGEST_METHOD_XPATH, ""); + final String digestValueStr = + XPathUtils.getElementValue(contentElem, DIGEST_VALUE_XPATH, ""); byte[] digestValue = null; try { digestValue = Base64Utils.decode(digestValueStr, true); - } catch (IOException e) { - throw new MOAApplicationException("2270", null); + } catch (final IOException e) { + throw new MOAApplicationException("2270", null); } return factory.createTransformParameter( - uri, - digestMethodStr, - digestValue); + uri, + digestMethodStr, + digestValue); } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java index 99a64d9..173ecbf 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java @@ -42,165 +42,163 @@ import at.gv.egovernment.moaspss.util.XPathUtils; /** * Utility methods for parsing XML requests definied in the MOA XML schema. - * + * * @author Patrick Peck * @version $Id$ */ public class RequestParserUtils { - // - // XPath expressions for parsing parts of a request - // - private static final String MOA = Constants.MOA_PREFIX + ":"; - private static final String REFERENCE_ATTR_NAME = "Reference"; - private static final String MIME_TYPE_XPATH = MOA + "MimeType"; - private static final String DESCRIPTION_XPATH = MOA + "Description"; - private static final String TYPE_XPATH = MOA + "Type"; - private static final String XML_ASSOC_CONTENT_XPATH = MOA + "Content"; - private static final String CONTENT_XPATH = MOA + "Base64Content | " + MOA + "XMLContent |" + MOA + "LocRefContent"; - private static final String ANY_OTHER_XPATH = "*[namespace-uri() != \"" + Constants.MOA_NS_URI + "\"]"; - - /** - * Parse a <code>XMLDataObjectAssociationType</code> kind of DOM element. - * - * @param assocElem - * The <code>XMLDataObjectAssociationType</code> kind of DOM - * elmeent to parse. - * @return The <code>XMLDataObjectAssociation</code> API object containing - * the data from the <code>XMLDataObjectAssociationType</code> DOM - * element. - */ - public static XMLDataObjectAssociation parseXMLDataObjectAssociation(Element assocElem) { - SPSSFactory factory = SPSSFactory.getInstance(); - MetaInfo metaInfo = parseMetaInfo(assocElem); - Element contentElem = (Element) XPathUtils.selectSingleNode(assocElem, XML_ASSOC_CONTENT_XPATH); - Content content = parseContent(contentElem); - - return factory.createXMLDataObjectAssociation(metaInfo, content); - } - - /** - * Parse a <code>MetaInfoType</code> kind of DOM element. - * - * @param metaInfoElem - * The <code>MetaInfoType</code> kind of DOM element. - * @return The <code>MetaInfo</code> API object containing the data from the - * <code>metaInfoElem</code>. - */ - public static MetaInfo parseMetaInfo(Element metaInfoElem) { - SPSSFactory factory = SPSSFactory.getInstance(); - String mimeType = XPathUtils.getElementValue(metaInfoElem, MIME_TYPE_XPATH, null); - String description = XPathUtils.getElementValue(metaInfoElem, DESCRIPTION_XPATH, null); - NodeList anyOther = XPathUtils.selectNodeList(metaInfoElem, ANY_OTHER_XPATH); - String type = XPathUtils.getElementValue(metaInfoElem, TYPE_XPATH, null); - - return factory.createMetaInfo(mimeType, description, anyOther, type); - } - - /** - * Parse a <code>ContentOptionalRefType</code> or - * <code>ContentRequiredRefType</code> kind of DOM element. - * - * @param contentParentElem - * The DOM element being the parent of the content element. - * @return The <code>Content</code> API object containing the data from the - * given DOM element. - */ - public static Content parseContent(Element contentParentElem) { - SPSSFactory factory = SPSSFactory.getInstance(); - String referenceURI = contentParentElem.hasAttribute(REFERENCE_ATTR_NAME) - ? contentParentElem.getAttribute(REFERENCE_ATTR_NAME) : null; - Element contentElem = (Element) XPathUtils.selectSingleNode(contentParentElem, CONTENT_XPATH); - - if (contentElem == null) { - return factory.createContent(referenceURI); - } - - if ("Base64Content".equals(contentElem.getLocalName())) { - String base64String = DOMUtils.getText(contentElem); - return factory.createContent(Base64Utils.decodeToStream(base64String, true), referenceURI); - } else if ("LocRefContent".equals(contentElem.getLocalName())) { - String locationReferenceURI = DOMUtils.getText(contentElem); - return factory.createContent(locationReferenceURI, referenceURI); - } else { // "XMLContent".equals(contentElem.getLocalName()) - return factory.createContent(contentElem.getChildNodes(), referenceURI); - } - } - - /** - * Get the signing time from a Verfiy(CMS|XML)SignatureRequest. - * - * @param requestElem - * A <code>Verify(CMS|XML)SignatureRequest</code> DOM element. - * @param dateTimeXPath - * The XPath to lookup the <code>DateTime</code> element within - * the request. - * @return Date The date and time corresponding to the <code>DateTime</code> - * element in the request. If no <code>DateTime</code> element - * exists in the request, <code>null</code> is returned. - * @throws MOAApplicationException - * An error occurred during a parsing the <code>DateTime</code> - * element or creating the return value. - */ - public static Date parseDateTime(Element requestElem, String dateTimeXPath) throws MOAApplicationException { - - Element dateTimeElem; - String dateTimeText; - - // select the DateTime element - dateTimeElem = (Element) XPathUtils.selectSingleNode(requestElem, dateTimeXPath); - - // parse a date from the element value - if (dateTimeElem != null) { - dateTimeText = DOMUtils.getText(dateTimeElem); - try { - return DateTimeUtils.parseDateTime(dateTimeText); - } catch (ParseException e) { - throw new MOAApplicationException("1104", new Object[] { dateTimeText }); - } - } else { - return null; - } - } - - /** - * Get the signing time from a Verfiy(CMS|XML)SignatureRequest. - * - * @param requestElem - * A <code>Verify(CMS|XML)SignatureRequest</code> DOM element. - * @param dateTimeXPath - * The XPath to lookup the <code>DateTime</code> element within - * the request. - * @return Date The date and time corresponding to the <code>DateTime</code> - * element in the request. If no <code>DateTime</code> element - * exists in the request, <code>null</code> is returned. - * @throws MOAApplicationException - * An error occurred during a parsing the <code>DateTime</code> - * element or creating the return value. - */ - public static boolean parseExtendedValidation(Element requestElem, String extendedValidationXPath, - boolean defaultValue) throws MOAApplicationException { - - Element dateTimeElem; - String dateTimeText; - - // select the DateTime element - dateTimeElem = (Element) XPathUtils.selectSingleNode(requestElem, extendedValidationXPath); - - // parse a date from the element value - if (dateTimeElem != null) { - dateTimeText = DOMUtils.getText(dateTimeElem); - String xsdBoolean = dateTimeText.trim(); - if ("".equals(xsdBoolean)) - return defaultValue; - if("true".equalsIgnoreCase(xsdBoolean) || - "1".equalsIgnoreCase(xsdBoolean)) { - return true; - } else { - return false; - } - } else { - return defaultValue; - } - } + // + // XPath expressions for parsing parts of a request + // + private static final String MOA = Constants.MOA_PREFIX + ":"; + private static final String REFERENCE_ATTR_NAME = "Reference"; + private static final String MIME_TYPE_XPATH = MOA + "MimeType"; + private static final String DESCRIPTION_XPATH = MOA + "Description"; + private static final String TYPE_XPATH = MOA + "Type"; + private static final String XML_ASSOC_CONTENT_XPATH = MOA + "Content"; + private static final String CONTENT_XPATH = MOA + "Base64Content | " + MOA + "XMLContent |" + MOA + + "LocRefContent"; + private static final String ANY_OTHER_XPATH = "*[namespace-uri() != \"" + Constants.MOA_NS_URI + "\"]"; + + /** + * Parse a <code>XMLDataObjectAssociationType</code> kind of DOM element. + * + * @param assocElem The <code>XMLDataObjectAssociationType</code> kind of DOM + * elmeent to parse. + * @return The <code>XMLDataObjectAssociation</code> API object containing the + * data from the <code>XMLDataObjectAssociationType</code> DOM element. + */ + public static XMLDataObjectAssociation parseXMLDataObjectAssociation(Element assocElem) { + final SPSSFactory factory = SPSSFactory.getInstance(); + final MetaInfo metaInfo = parseMetaInfo(assocElem); + final Element contentElem = (Element) XPathUtils.selectSingleNode(assocElem, XML_ASSOC_CONTENT_XPATH); + final Content content = parseContent(contentElem); + + return factory.createXMLDataObjectAssociation(metaInfo, content); + } + + /** + * Parse a <code>MetaInfoType</code> kind of DOM element. + * + * @param metaInfoElem The <code>MetaInfoType</code> kind of DOM element. + * @return The <code>MetaInfo</code> API object containing the data from the + * <code>metaInfoElem</code>. + */ + public static MetaInfo parseMetaInfo(Element metaInfoElem) { + final SPSSFactory factory = SPSSFactory.getInstance(); + final String mimeType = XPathUtils.getElementValue(metaInfoElem, MIME_TYPE_XPATH, null); + final String description = XPathUtils.getElementValue(metaInfoElem, DESCRIPTION_XPATH, null); + final NodeList anyOther = XPathUtils.selectNodeList(metaInfoElem, ANY_OTHER_XPATH); + final String type = XPathUtils.getElementValue(metaInfoElem, TYPE_XPATH, null); + + return factory.createMetaInfo(mimeType, description, anyOther, type); + } + + /** + * Parse a <code>ContentOptionalRefType</code> or + * <code>ContentRequiredRefType</code> kind of DOM element. + * + * @param contentParentElem The DOM element being the parent of the content + * element. + * @return The <code>Content</code> API object containing the data from the + * given DOM element. + */ + public static Content parseContent(Element contentParentElem) { + final SPSSFactory factory = SPSSFactory.getInstance(); + final String referenceURI = contentParentElem.hasAttribute(REFERENCE_ATTR_NAME) + ? contentParentElem.getAttribute(REFERENCE_ATTR_NAME) + : null; + final Element contentElem = (Element) XPathUtils.selectSingleNode(contentParentElem, CONTENT_XPATH); + + if (contentElem == null) { + return factory.createContent(referenceURI); + } + + if ("Base64Content".equals(contentElem.getLocalName())) { + final String base64String = DOMUtils.getText(contentElem); + return factory.createContent(Base64Utils.decodeToStream(base64String, true), referenceURI); + } else if ("LocRefContent".equals(contentElem.getLocalName())) { + final String locationReferenceURI = DOMUtils.getText(contentElem); + return factory.createContent(locationReferenceURI, referenceURI); + } else { // "XMLContent".equals(contentElem.getLocalName()) + return factory.createContent(contentElem.getChildNodes(), referenceURI); + } + } + + /** + * Get the signing time from a Verfiy(CMS|XML)SignatureRequest. + * + * @param requestElem A <code>Verify(CMS|XML)SignatureRequest</code> DOM + * element. + * @param dateTimeXPath The XPath to lookup the <code>DateTime</code> element + * within the request. + * @return Date The date and time corresponding to the <code>DateTime</code> + * element in the request. If no <code>DateTime</code> element exists in + * the request, <code>null</code> is returned. + * @throws MOAApplicationException An error occurred during a parsing the + * <code>DateTime</code> element or creating the + * return value. + */ + public static Date parseDateTime(Element requestElem, String dateTimeXPath) throws MOAApplicationException { + + Element dateTimeElem; + String dateTimeText; + + // select the DateTime element + dateTimeElem = (Element) XPathUtils.selectSingleNode(requestElem, dateTimeXPath); + + // parse a date from the element value + if (dateTimeElem != null) { + dateTimeText = DOMUtils.getText(dateTimeElem); + try { + return DateTimeUtils.parseDateTime(dateTimeText); + } catch (final ParseException e) { + throw new MOAApplicationException("1104", new Object[] { dateTimeText }); + } + } else { + return null; + } + } + + /** + * Get the signing time from a Verfiy(CMS|XML)SignatureRequest. + * + * @param requestElem A <code>Verify(CMS|XML)SignatureRequest</code> DOM + * element. + * @param dateTimeXPath The XPath to lookup the <code>DateTime</code> element + * within the request. + * @return Date The date and time corresponding to the <code>DateTime</code> + * element in the request. If no <code>DateTime</code> element exists in + * the request, <code>null</code> is returned. + * @throws MOAApplicationException An error occurred during a parsing the + * <code>DateTime</code> element or creating the + * return value. + */ + public static boolean parseExtendedValidation(Element requestElem, String extendedValidationXPath, + boolean defaultValue) throws MOAApplicationException { + + Element dateTimeElem; + String dateTimeText; + + // select the DateTime element + dateTimeElem = (Element) XPathUtils.selectSingleNode(requestElem, extendedValidationXPath); + + // parse a date from the element value + if (dateTimeElem != null) { + dateTimeText = DOMUtils.getText(dateTimeElem); + final String xsdBoolean = dateTimeText.trim(); + if ("".equals(xsdBoolean)) { + return defaultValue; + } + if ("true".equalsIgnoreCase(xsdBoolean) || + "1".equalsIgnoreCase(xsdBoolean)) { + return true; + } else { + return false; + } + } else { + return defaultValue; + } + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java index a7113fd..dff1fcc 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java @@ -21,16 +21,14 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.io.IOException; import java.security.cert.CertificateEncodingException; import java.security.cert.X509Certificate; -import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; -import java.util.Calendar; import java.util.TimeZone; import javax.xml.bind.DatatypeConverter; @@ -44,8 +42,6 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; import at.gv.egovernment.moa.spss.MOAApplicationException; import at.gv.egovernment.moa.spss.MOASystemException; import at.gv.egovernment.moa.spss.api.common.ExtendedCertificateCheckResult; @@ -53,10 +49,12 @@ import at.gv.egovernment.moa.spss.api.common.TslInfos; import at.gv.egovernment.moaspss.util.Base64Utils; import at.gv.egovernment.moaspss.util.Constants; import at.gv.egovernment.moaspss.util.MiscUtil; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; /** * Utility methods used by the verious <code>ResponseBuilder</code> classes. - * + * * @author Patrick Peck * @version $Id$ */ @@ -71,35 +69,35 @@ public class ResponseBuilderUtils { /** * Add an DOM element with a specific name as child to a root element - * + * * @param elementName Name of the DOM element - * @param response Full document with namespace information + * @param response Full document with namespace information * @param rootElement Root element * @return new child DOM element */ public static Element addChildElement(String elementName, Document response, - Element rootElement) { - Element childElement = response.createElementNS(MOA_NS_URI, elementName); - rootElement.appendChild(childElement); - return childElement; - + Element rootElement) { + final Element childElement = response.createElementNS(MOA_NS_URI, elementName); + rootElement.appendChild(childElement); + return childElement; + } - + /** * Create a response element with all the namespaces set. - * + * * @param responseName The name of the response root element. * @return A DOM document containing the response root element and predefined - * MOA, DSIG and XML namespace declarations. + * MOA, DSIG and XML namespace declarations. * @throws MOASystemException An error building the response document. */ public static Document createResponse(String responseName) - throws MOASystemException { + throws MOASystemException { try { - DocumentBuilder docBuilder = - DocumentBuilderFactory.newInstance().newDocumentBuilder(); - DOMImplementation impl = docBuilder.getDOMImplementation(); + final DocumentBuilder docBuilder = + DocumentBuilderFactory.newInstance().newDocumentBuilder(); + final DOMImplementation impl = docBuilder.getDOMImplementation(); Document response; Element root; String attrValue; @@ -113,159 +111,170 @@ public class ResponseBuilderUtils { root.setAttributeNS(XMLNS_NS_URI, attrValue, DSIG_NS_URI); return response; - } catch (ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { throw new MOASystemException("2200", null, e); } } /** * Add a <code>SignerInfo</code> element to the response. - * - * @param response The response document, in order to create new elements in - * it. - * @param root The root element into which the <code>SignerInfo</code> element - * will be inserted. - * @param cert The signer certificate to add. - * @param isQualified Indicates, whether <code>cert</code> is a qualified - * certificate. - * @param isPublicAuthority Indicates, whether <code>cert</code> is - * certificate owned by a public authority. + * + * @param response The response document, in order to create new + * elements in it. + * @param root The root element into which the + * <code>SignerInfo</code> element will be inserted. + * @param cert The signer certificate to add. + * @param isQualified Indicates, whether <code>cert</code> is a qualified + * certificate. + * @param isPublicAuthority Indicates, whether <code>cert</code> is certificate + * owned by a public authority. * @param publicAuthorityID Information about the public authority owning - * <code>cert</code>. Must not be <code>null</code>, if - * <code>isPublicAuthority ! = null</code>. + * <code>cert</code>. Must not be <code>null</code>, if + * <code>isPublicAuthority ! = null</code>. * @throws MOAApplicationException An error occurred reading data from the - * certificate. + * certificate. */ public static void addSignerInfo( - Document response, - Element root, - X509Certificate cert, - boolean isQualified, - String qcSource, - boolean isPublicAuthority, - String publicAuthorityID, - boolean isSSCD, - String sscdSource, - String issuerCountryCode, - TslInfos tslInfos) - throws MOAApplicationException { - - Element signerInfoElem = response.createElementNS(MOA_NS_URI, "SignerInfo"); - Element x509DataElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509Data"); - Element x509IssuerSerialElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509IssuerSerial"); - Element x509IssuerElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509IssuerName"); - String issuer = cert.getIssuerDN().getName(); - Element x509SerialNumberElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509SerialNumber"); - String serialNumber = cert.getSerialNumber().toString(); - Element x509SubjectNameElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509SubjectName"); - Element x509CertificateElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509Certificate"); - Element qualifiedCertificateElem = - isQualified - ? response.createElementNS(MOA_NS_URI, "QualifiedCertificate") - : null; - Element sscdElem = - isSSCD - ? response.createElementNS(MOA_NS_URI, "SecureSignatureCreationDevice") - : null; + Document response, + Element root, + X509Certificate cert, + boolean isQualified, + String qcSource, + boolean isPublicAuthority, + String publicAuthorityID, + boolean isSSCD, + String sscdSource, + String issuerCountryCode, + TslInfos tslInfos) + throws MOAApplicationException { + + final Element signerInfoElem = response.createElementNS(MOA_NS_URI, "SignerInfo"); + final Element x509DataElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509Data"); + final Element x509IssuerSerialElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509IssuerSerial"); + final Element x509IssuerElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509IssuerName"); + final String issuer = cert.getIssuerDN().getName(); + final Element x509SerialNumberElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509SerialNumber"); + final String serialNumber = cert.getSerialNumber().toString(); + final Element x509SubjectNameElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509SubjectName"); + final Element x509CertificateElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509Certificate"); + final Element qualifiedCertificateElem = + isQualified + ? response.createElementNS(MOA_NS_URI, "QualifiedCertificate") + : null; + final Element sscdElem = + isSSCD + ? response.createElementNS(MOA_NS_URI, "SecureSignatureCreationDevice") + : null; Element issuerCountryCodeElem = null; if (issuerCountryCode != null) { - issuerCountryCodeElem = response.createElementNS(MOA_NS_URI, "IssuerCountryCode"); - issuerCountryCodeElem.setTextContent(issuerCountryCode); + issuerCountryCodeElem = response.createElementNS(MOA_NS_URI, "IssuerCountryCode"); + issuerCountryCodeElem.setTextContent(issuerCountryCode); } - - //add TSL infos + + // add TSL infos Element tslInfoElement = null; if (tslInfos != null) { - tslInfoElement = response.createElementNS(MOA_NS_URI, "TSLInformation"); - - //append TSL issuer country-code - if (MiscUtil.isNotEmpty(tslInfos.getTslIssuerCountry())); { - Element tslIssuerCountryCodeElem = response.createElementNS(MOA_NS_URI, "TSLIssuerCountryCode"); - tslIssuerCountryCodeElem.setTextContent(tslInfos.getTslIssuerCountry()); - tslInfoElement.appendChild(tslIssuerCountryCodeElem); - - } - - //append Service-Type Status - if (MiscUtil.isNotEmpty(tslInfos.getServiceTypeStatus())); { - Element tslServiceInfo = response.createElementNS(MOA_NS_URI, "ServiceTypeStatus"); - tslServiceInfo.setTextContent(tslInfos.getServiceTypeStatus()); - tslInfoElement.appendChild(tslServiceInfo); - - } - - //append Service-Type Identifier - if (MiscUtil.isNotEmpty(tslInfos.getServiceTypeIdentifier())); { - Element tslServiceInfo = response.createElementNS(MOA_NS_URI, "ServiceTypeIdentifier"); - tslServiceInfo.setTextContent(tslInfos.getServiceTypeIdentifier()); - tslInfoElement.appendChild(tslServiceInfo); - - } - - //append qualifiers - if (tslInfos.getQualifiers() != null && tslInfos.getQualifiers().size() > 0) { - Element tslQualifiers = response.createElementNS(MOA_NS_URI, "Qualifiers"); - - for (String el : tslInfos.getQualifiers()) { - Element tslQualifier = response.createElementNS(MOA_NS_URI, "Qualifier"); - tslQualifier.setTextContent(el); - tslQualifiers.appendChild(tslQualifier); - - } - - tslInfoElement.appendChild(tslQualifiers); - - } - - //append additional service information - if (tslInfos.getAdditionalServiceInformation() != null - && tslInfos.getAdditionalServiceInformation().size() > 0) { - Element tslAdditionalServiceInformations = response.createElementNS(MOA_NS_URI, "AdditionalServiceInformations"); - - for (String el : tslInfos.getAdditionalServiceInformation()) { - Element tslAdditionalServiceInformation = response.createElementNS(MOA_NS_URI, "AdditionalServiceInformation"); - tslAdditionalServiceInformation.setTextContent(el); - tslAdditionalServiceInformations.appendChild(tslAdditionalServiceInformation); - - } - tslInfoElement.appendChild(tslAdditionalServiceInformations); - - } + tslInfoElement = response.createElementNS(MOA_NS_URI, "TSLInformation"); + + // append TSL issuer country-code + if (MiscUtil.isNotEmpty(tslInfos.getTslIssuerCountry())) { + ; + } + { + final Element tslIssuerCountryCodeElem = response.createElementNS(MOA_NS_URI, "TSLIssuerCountryCode"); + tslIssuerCountryCodeElem.setTextContent(tslInfos.getTslIssuerCountry()); + tslInfoElement.appendChild(tslIssuerCountryCodeElem); + + } + + // append Service-Type Status + if (MiscUtil.isNotEmpty(tslInfos.getServiceTypeStatus())) { + ; + } + { + final Element tslServiceInfo = response.createElementNS(MOA_NS_URI, "ServiceTypeStatus"); + tslServiceInfo.setTextContent(tslInfos.getServiceTypeStatus()); + tslInfoElement.appendChild(tslServiceInfo); + + } + + // append Service-Type Identifier + if (MiscUtil.isNotEmpty(tslInfos.getServiceTypeIdentifier())) { + ; + } + { + final Element tslServiceInfo = response.createElementNS(MOA_NS_URI, "ServiceTypeIdentifier"); + tslServiceInfo.setTextContent(tslInfos.getServiceTypeIdentifier()); + tslInfoElement.appendChild(tslServiceInfo); + + } + + // append qualifiers + if (tslInfos.getQualifiers() != null && tslInfos.getQualifiers().size() > 0) { + final Element tslQualifiers = response.createElementNS(MOA_NS_URI, "Qualifiers"); + + for (final String el : tslInfos.getQualifiers()) { + final Element tslQualifier = response.createElementNS(MOA_NS_URI, "Qualifier"); + tslQualifier.setTextContent(el); + tslQualifiers.appendChild(tslQualifier); + + } + + tslInfoElement.appendChild(tslQualifiers); + + } + + // append additional service information + if (tslInfos.getAdditionalServiceInformation() != null + && tslInfos.getAdditionalServiceInformation().size() > 0) { + final Element tslAdditionalServiceInformations = response.createElementNS(MOA_NS_URI, + "AdditionalServiceInformations"); + + for (final String el : tslInfos.getAdditionalServiceInformation()) { + final Element tslAdditionalServiceInformation = response.createElementNS(MOA_NS_URI, + "AdditionalServiceInformation"); + tslAdditionalServiceInformation.setTextContent(el); + tslAdditionalServiceInformations.appendChild(tslAdditionalServiceInformation); + + } + tslInfoElement.appendChild(tslAdditionalServiceInformations); + + } } - - Element publicAuthorityElem = - isPublicAuthority - ? response.createElementNS(MOA_NS_URI, "PublicAuthority") - : null; - Element codeElem = - publicAuthorityID != null - ? response.createElementNS(MOA_NS_URI, "Code") - : null; + + final Element publicAuthorityElem = + isPublicAuthority + ? response.createElementNS(MOA_NS_URI, "PublicAuthority") + : null; + final Element codeElem = + publicAuthorityID != null + ? response.createElementNS(MOA_NS_URI, "Code") + : null; // fill in text x509IssuerElem.appendChild(response.createTextNode(issuer)); x509SerialNumberElem.appendChild(response.createTextNode(serialNumber)); try { - RFC2253NameParser parser = - new RFC2253NameParser(cert.getSubjectDN().getName()); - String subjectRfc2253 = parser.parse().getRFC2253String(); + final RFC2253NameParser parser = + new RFC2253NameParser(cert.getSubjectDN().getName()); + final String subjectRfc2253 = parser.parse().getRFC2253String(); x509SubjectNameElem.appendChild(response.createTextNode(subjectRfc2253)); - } catch (RFC2253NameParserException e) { + } catch (final RFC2253NameParserException e) { x509SubjectNameElem.appendChild( - response.createTextNode(cert.getSubjectDN().getName())); + response.createTextNode(cert.getSubjectDN().getName())); } try { x509CertificateElem.appendChild( - response.createTextNode(Base64Utils.encode(cert.getEncoded()))); - } catch (CertificateEncodingException e) { + response.createTextNode(Base64Utils.encode(cert.getEncoded()))); + } catch (final CertificateEncodingException e) { throw new MOAApplicationException("2245", null, e); - } catch (IOException e) { + } catch (final IOException e) { throw new MOAApplicationException("2245", null, e); } @@ -276,10 +285,11 @@ public class ResponseBuilderUtils { x509DataElem.appendChild(x509IssuerSerialElem); x509DataElem.appendChild(x509CertificateElem); if (isQualified) { - if (qcSource.compareToIgnoreCase("TSL") == 0) - qualifiedCertificateElem.setAttributeNS(MOA_NS_URI, "Source", qcSource); - - x509DataElem.appendChild(qualifiedCertificateElem); + if (qcSource.compareToIgnoreCase("TSL") == 0) { + qualifiedCertificateElem.setAttributeNS(MOA_NS_URI, "Source", qcSource); + } + + x509DataElem.appendChild(qualifiedCertificateElem); } if (isPublicAuthority) { x509DataElem.appendChild(publicAuthorityElem); @@ -289,16 +299,18 @@ public class ResponseBuilderUtils { } } if (isSSCD) { - sscdElem.setAttributeNS(MOA_NS_URI, "Source", sscdSource); - x509DataElem.appendChild(sscdElem); - } - if (issuerCountryCodeElem != null) - x509DataElem.appendChild(issuerCountryCodeElem); - - //add TSL infos to X509Date if TSL infos exists - if (tslInfoElement != null) - x509DataElem.appendChild(tslInfoElement); - + sscdElem.setAttributeNS(MOA_NS_URI, "Source", sscdSource); + x509DataElem.appendChild(sscdElem); + } + if (issuerCountryCodeElem != null) { + x509DataElem.appendChild(issuerCountryCodeElem); + } + + // add TSL infos to X509Date if TSL infos exists + if (tslInfoElement != null) { + x509DataElem.appendChild(tslInfoElement); + } + signerInfoElem.appendChild(x509DataElem); root.appendChild(signerInfoElem); } @@ -306,24 +318,24 @@ public class ResponseBuilderUtils { /** * Add an element containing <code>Code</code> and <code>Info</code> * subelements. - * - * @param response The response document, in order to create new elements in - * it. - * @param root The root element into which to insert the newly created - * element. + * + * @param response The response document, in order to create new elements in + * it. + * @param root The root element into which to insert the newly created + * element. * @param elementName The name of the newly created element. - * @param code The content of the <code>Code</code> subelement. - * @param info The content of the <code>Info</code> subelement. + * @param code The content of the <code>Code</code> subelement. + * @param info The content of the <code>Info</code> subelement. */ public static void addCodeInfoElement( - Document response, - Element root, - String elementName, - int code, - NodeList info) { - - Element codeInfoElem = response.createElementNS(MOA_NS_URI, elementName); - Element codeElem = response.createElementNS(MOA_NS_URI, "Code"); + Document response, + Element root, + String elementName, + int code, + NodeList info) { + + final Element codeInfoElem = response.createElementNS(MOA_NS_URI, elementName); + final Element codeElem = response.createElementNS(MOA_NS_URI, "Code"); Element infoElem; int i; @@ -339,34 +351,34 @@ public class ResponseBuilderUtils { } root.appendChild(codeInfoElem); } - + /** * Add an element containing <code>Code</code> and <code>Info</code> * subelements. - * - * @param response The response document, in order to create new elements in - * it. - * @param root The root element into which to insert the newly created - * element. + * + * @param response The response document, in order to create new elements in + * it. + * @param root The root element into which to insert the newly created + * element. * @param elementName The name of the newly created element. - * @param code The content of the <code>Code</code> subelement. - * @param info The content of the <code>Info</code> subelement. + * @param code The content of the <code>Code</code> subelement. + * @param info The content of the <code>Info</code> subelement. */ public static void addCodeInfoElement( - Document response, - Element root, - String elementName, - int code, - String info) { - - Element codeInfoElem = response.createElementNS(MOA_NS_URI, elementName); - Element codeElem = response.createElementNS(MOA_NS_URI, "Code"); + Document response, + Element root, + String elementName, + int code, + String info) { + + final Element codeInfoElem = response.createElementNS(MOA_NS_URI, elementName); + final Element codeElem = response.createElementNS(MOA_NS_URI, "Code"); Element infoElem; - int i; + final int i; codeElem.appendChild(response.createTextNode(Integer.toString(code))); codeInfoElem.appendChild(codeElem); - + if (info != null) { infoElem = response.createElementNS(MOA_NS_URI, "Info"); infoElem.appendChild(response.createTextNode(info)); @@ -376,137 +388,138 @@ public class ResponseBuilderUtils { } public static void addSigningTime(Document response, - Element root, - Date signingTime) { - if(signingTime != null) { - Element extElem = response.createElementNS(MOA_NS_URI, "SigningTime"); - TimeZone tz = TimeZone.getTimeZone("UTC"); - Calendar calendar = new GregorianCalendar(); + Element root, + Date signingTime) { + if (signingTime != null) { + final Element extElem = response.createElementNS(MOA_NS_URI, "SigningTime"); + final TimeZone tz = TimeZone.getTimeZone("UTC"); + final Calendar calendar = new GregorianCalendar(); calendar.setTimeZone(tz); calendar.setTime(signingTime); - String date = DatatypeConverter.printDateTime(calendar); + final String date = DatatypeConverter.printDateTime(calendar); extElem.appendChild(response.createTextNode(date)); root.appendChild(extElem); } } public static void addSignatureAlgorithm(Document response, - Element root, - String algorithm) { - if(algorithm != null) { - Element extElem = response.createElementNS(MOA_NS_URI, "SignatureAlgorithm"); - extElem.appendChild(response.createTextNode(algorithm)); - root.appendChild(extElem); - } + Element root, + String algorithm) { + if (algorithm != null) { + final Element extElem = response.createElementNS(MOA_NS_URI, "SignatureAlgorithm"); + extElem.appendChild(response.createTextNode(algorithm)); + root.appendChild(extElem); + } } - + public static void addSignatureCoversFullPDF(Document response, - Element root, - Boolean coversFull) { - if( coversFull != null) { - Element extElem = response.createElementNS(MOA_NS_URI, "SignatureCoversFullPDF"); - extElem.appendChild(response.createTextNode(String.valueOf(coversFull))); - root.appendChild(extElem); - } + Element root, + Boolean coversFull) { + if (coversFull != null) { + final Element extElem = response.createElementNS(MOA_NS_URI, "SignatureCoversFullPDF"); + extElem.appendChild(response.createTextNode(String.valueOf(coversFull))); + root.appendChild(extElem); + } } - + public static void addSignatureByteRange(Document response, - Element root, - int[] byteRange) { - if(byteRange != null) { - String byteRangeTextual = StringUtils.EMPTY; - for (int el : byteRange) - byteRangeTextual += "," + String.valueOf(el); - - Element extElem = response.createElementNS(MOA_NS_URI, "SignatureByteRange"); - extElem.appendChild(response.createTextNode(byteRangeTextual.substring(1))); - root.appendChild(extElem); - } + Element root, + int[] byteRange) { + if (byteRange != null) { + String byteRangeTextual = StringUtils.EMPTY; + for (final int el : byteRange) { + byteRangeTextual += "," + String.valueOf(el); + } + + final Element extElem = response.createElementNS(MOA_NS_URI, "SignatureByteRange"); + extElem.appendChild(response.createTextNode(byteRangeTextual.substring(1))); + root.appendChild(extElem); + } } - + public static Element createAndAddChildElement(Document response, Element root, String name) { - Element element = response.createElementNS(MOA_NS_URI, name); - root.appendChild(element); - return element; - + final Element element = response.createElementNS(MOA_NS_URI, name); + root.appendChild(element); + return element; + } - + public static void addHashAlgorithm(Document response, - Element root, - String algorithm) { - if(algorithm != null) { - Element extElem = response.createElementNS(MOA_NS_URI, "HashAlgorithm"); - extElem.appendChild(response.createTextNode(algorithm)); - root.appendChild(extElem); - } -} - + Element root, + String algorithm) { + if (algorithm != null) { + final Element extElem = response.createElementNS(MOA_NS_URI, "HashAlgorithm"); + extElem.appendChild(response.createTextNode(algorithm)); + root.appendChild(extElem); + } + } + public static void addExtendendResult(Document response, - Element root, - ExtendedCertificateCheckResult result) { - Element extElem = response.createElementNS(MOA_NS_URI, "ExtendedCertificateCheck"); - - Element extMajorElem = response.createElementNS(MOA_NS_URI, "Major"); - - Element codeMajorCodeElem = response.createElementNS(MOA_NS_URI, "Code"); - Element codeMajorNameElem = response.createElementNS(MOA_NS_URI, "Name"); - codeMajorCodeElem.appendChild(response.createTextNode(Integer.toString( - result.getMajorCode()))); - codeMajorNameElem.appendChild(response.createTextNode(result.getMajorInfo())); - - extMajorElem.appendChild(codeMajorCodeElem); - extMajorElem.appendChild(codeMajorNameElem); - - extElem.appendChild(extMajorElem); - - if(result.getMinorCode() >= 0) { - Element extMinorElem = response.createElementNS(MOA_NS_URI, "Minor"); - Element codeMinorCodeElem = response.createElementNS(MOA_NS_URI, "Code"); - Element codeMinorNameElem = response.createElementNS(MOA_NS_URI, "Name"); - codeMinorCodeElem.appendChild(response.createTextNode(Integer.toString( - result.getMinorCode()))); - codeMinorNameElem.appendChild(response.createTextNode(result.getMinorInfo())); - - extMinorElem.appendChild(codeMinorCodeElem); - extMinorElem.appendChild(codeMinorNameElem); - - extElem.appendChild(extMinorElem); - } - - root.appendChild(extElem); + Element root, + ExtendedCertificateCheckResult result) { + final Element extElem = response.createElementNS(MOA_NS_URI, "ExtendedCertificateCheck"); + + final Element extMajorElem = response.createElementNS(MOA_NS_URI, "Major"); + + final Element codeMajorCodeElem = response.createElementNS(MOA_NS_URI, "Code"); + final Element codeMajorNameElem = response.createElementNS(MOA_NS_URI, "Name"); + codeMajorCodeElem.appendChild(response.createTextNode(Integer.toString( + result.getMajorCode()))); + codeMajorNameElem.appendChild(response.createTextNode(result.getMajorInfo())); + + extMajorElem.appendChild(codeMajorCodeElem); + extMajorElem.appendChild(codeMajorNameElem); + + extElem.appendChild(extMajorElem); + + if (result.getMinorCode() >= 0) { + final Element extMinorElem = response.createElementNS(MOA_NS_URI, "Minor"); + final Element codeMinorCodeElem = response.createElementNS(MOA_NS_URI, "Code"); + final Element codeMinorNameElem = response.createElementNS(MOA_NS_URI, "Name"); + codeMinorCodeElem.appendChild(response.createTextNode(Integer.toString( + result.getMinorCode()))); + codeMinorNameElem.appendChild(response.createTextNode(result.getMinorInfo())); + + extMinorElem.appendChild(codeMinorCodeElem); + extMinorElem.appendChild(codeMinorNameElem); + + extElem.appendChild(extMinorElem); + } + + root.appendChild(extElem); } - + /** * Add an element containing <code>Code</code> and <code>Info</code> * subelements. - * - * @param response The response document, in order to create new elements in - * it. - * @param root The root element into which to insert the newly created - * element. + * + * @param response The response document, in order to create new elements in + * it. + * @param root The root element into which to insert the newly created + * element. * @param elementName The name of the newly created element. - * @param code The content of the <code>Code</code> subelement. - * @param info The content of the <code>Info</code> subelement. + * @param code The content of the <code>Code</code> subelement. + * @param info The content of the <code>Info</code> subelement. */ public static void addFormCheckElement( - Document response, - Element root, - String elementName, - int code, - String name) { - - Element codeInfoElem = response.createElementNS(MOA_NS_URI, elementName); - Element codeElem = response.createElementNS(MOA_NS_URI, "Code"); + Document response, + Element root, + String elementName, + int code, + String name) { + + final Element codeInfoElem = response.createElementNS(MOA_NS_URI, elementName); + final Element codeElem = response.createElementNS(MOA_NS_URI, "Code"); Element infoElem; - + codeElem.appendChild(response.createTextNode(Integer.toString(code))); codeInfoElem.appendChild(codeElem); - + infoElem = response.createElementNS(MOA_NS_URI, "Name"); infoElem.appendChild(response.createTextNode(name)); codeInfoElem.appendChild(infoElem); - + root.appendChild(codeInfoElem); } - + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java index 6dc4803..7a246d6 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.util.ArrayList; @@ -48,9 +47,9 @@ import at.gv.egovernment.moaspss.util.DOMUtils; import at.gv.egovernment.moaspss.util.XPathUtils; /** - * A parser to parse XMLDsig <code>Transform</code> DOM elements into their - * MOA SPSS API representation. - * + * A parser to parse XMLDsig <code>Transform</code> DOM elements into their MOA + * SPSS API representation. + * * @author Patrick Peck * @version $Id$ */ @@ -60,39 +59,38 @@ public class TransformParser { // private static final String DSIG = Constants.DSIG_PREFIX + ":"; private static final String DSIG_FILTER2 = - Constants.DSIG_FILTER2_PREFIX + ":"; + Constants.DSIG_FILTER2_PREFIX + ":"; private static final String XSLT = Constants.XSLT_PREFIX + ":"; private static final String EC = Constants.DSIG_EC_PREFIX + ":"; private static final String TRANSFORM_XPATH = DSIG + "Transform"; private static final String XPATH_XPATH = DSIG + "XPath"; private static final String XSLT_ELEMENT_XPATH = XSLT + "stylesheet"; private static final String XPATH2_XPATH = - (DSIG_FILTER2 + "XPath[@Filter=\"intersect\"] | ") - + (DSIG_FILTER2 + "XPath[@Filter=\"subtract\"] | ") - + (DSIG_FILTER2 + "XPath[@Filter=\"union\"]"); + DSIG_FILTER2 + "XPath[@Filter=\"intersect\"] | " + + DSIG_FILTER2 + "XPath[@Filter=\"subtract\"] | " + + DSIG_FILTER2 + "XPath[@Filter=\"union\"]"; private static final String INCLUSIVE_NAMESPACES_XPATH = - EC + "InclusiveNamespaces"; + EC + "InclusiveNamespaces"; /** * The <code>SPSSFactory</code> to use for creating new API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); + private final SPSSFactory factory = SPSSFactory.getInstance(); /** * Parse an XMLDsig <code>Transforms</code> DOM element. - * + * * @param transformsElem The <code>Transforms</code> DOM element to parse. - * @return A <code>List</code> of <code>Transform</code> API objects - * containing the data from the individual <code>Transform</code> DOM - * elements. - * @throws MOAApplicationException An error occurred parsing the - * <code>Transforms</code> DOM element. + * @return A <code>List</code> of <code>Transform</code> API objects containing + * the data from the individual <code>Transform</code> DOM elements. + * @throws MOAApplicationException An error occurred parsing the + * <code>Transforms</code> DOM element. */ public List parseTransforms(Element transformsElem) - throws MOAApplicationException { - List transforms = new ArrayList(); - NodeIterator transformElems = - XPathUtils.selectNodeIterator(transformsElem, TRANSFORM_XPATH); + throws MOAApplicationException { + final List transforms = new ArrayList(); + final NodeIterator transformElems = + XPathUtils.selectNodeIterator(transformsElem, TRANSFORM_XPATH); Element transformElem; Transform transform; @@ -106,34 +104,31 @@ public class TransformParser { /** * Parse an XMLDsig <code>Transform</code> DOM element. - * + * * @param transformElem <code>Transform</code> DOM element to parse. - * @return The <code>Transform</code> API object containing the data - * from the <code>Transform</code> DOM element. - * @throws MOAApplicationException An error occurred parsing the - * <code>Transform</code> DOM element. + * @return The <code>Transform</code> API object containing the data from the + * <code>Transform</code> DOM element. + * @throws MOAApplicationException An error occurred parsing the + * <code>Transform</code> DOM element. */ public Transform parseTransform(Element transformElem) - throws MOAApplicationException { + throws MOAApplicationException { - String algorithmUri = transformElem.getAttribute("Algorithm"); + final String algorithmUri = transformElem.getAttribute("Algorithm"); if (CanonicalizationTransform.CANONICAL_XML.equals(algorithmUri) - || CanonicalizationTransform.CANONICAL_XML_WITH_COMMENTS.equals( - algorithmUri)) { + || CanonicalizationTransform.CANONICAL_XML_WITH_COMMENTS.equals( + algorithmUri)) { return factory.createCanonicalizationTransform(algorithmUri); - } else if ( - ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML.equals( + } else if (ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML.equals( algorithmUri) - || ExclusiveCanonicalizationTransform - .EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS - .equals( - algorithmUri)) { + || ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS + .equals( + algorithmUri)) { return parseExclusiveC14nTransform(algorithmUri, transformElem); } else if (Base64Transform.BASE64_DECODING.equals(algorithmUri)) { return factory.createBase64Transform(); - } else if ( - EnvelopedSignatureTransform.ENVELOPED_SIGNATURE.equals(algorithmUri)) { + } else if (EnvelopedSignatureTransform.ENVELOPED_SIGNATURE.equals(algorithmUri)) { return factory.createEnvelopedSignatureTransform(); } else if (XPathTransform.XPATH.equals(algorithmUri)) { return parseXPathTransform(transformElem); @@ -148,49 +143,47 @@ public class TransformParser { /** * Parse an exclusive canonicalization type of transform. - * - * @param algorithmUri The algorithm URI of the canonicalization algorithm. + * + * @param algorithmUri The algorithm URI of the canonicalization algorithm. * @param transformElem The <code>Transform</code> DOM element to parse. * @return An <code>ExclusiveCanonicalizationTransform</code> API object - * containing the data from the <code>transformElem</code>. + * containing the data from the <code>transformElem</code>. */ private Transform parseExclusiveC14nTransform( - String algorithmUri, - Element transformElem) - { + String algorithmUri, + Element transformElem) { - Element inclusiveNamespacesElem = - (Element) XPathUtils.selectSingleNode( - transformElem, - INCLUSIVE_NAMESPACES_XPATH); + final Element inclusiveNamespacesElem = + (Element) XPathUtils.selectSingleNode( + transformElem, + INCLUSIVE_NAMESPACES_XPATH); - List inclusiveNamespaces = new ArrayList(); - if (inclusiveNamespacesElem != null) - { - StringTokenizer tokenizer = new StringTokenizer(inclusiveNamespacesElem.getAttribute("PrefixList")); - while (tokenizer.hasMoreTokens()) - { + final List inclusiveNamespaces = new ArrayList(); + if (inclusiveNamespacesElem != null) { + final StringTokenizer tokenizer = new StringTokenizer(inclusiveNamespacesElem.getAttribute( + "PrefixList")); + while (tokenizer.hasMoreTokens()) { inclusiveNamespaces.add(tokenizer.nextToken()); } } return factory.createExclusiveCanonicalizationTransform( - algorithmUri, - inclusiveNamespaces); + algorithmUri, + inclusiveNamespaces); } /** * Parse an <code>XPath</code> type of <code>Transform</code>. - * + * * @param transformElem The <code>Transform</code> DOM element to parse. * @return The <code>Transform</code> API object representation of the - * <code>Transform</code> DOM element. - * @throws MOAApplicationException An error occurred parsing the - * <code>Transform</code> DOM element. + * <code>Transform</code> DOM element. + * @throws MOAApplicationException An error occurred parsing the + * <code>Transform</code> DOM element. */ private Transform parseXPathTransform(Element transformElem) - throws MOAApplicationException { - Element xPathElem = - (Element) XPathUtils.selectSingleNode(transformElem, XPATH_XPATH); + throws MOAApplicationException { + final Element xPathElem = + (Element) XPathUtils.selectSingleNode(transformElem, XPATH_XPATH); Map nsDecls; if (xPathElem == null) { @@ -205,22 +198,22 @@ public class TransformParser { /** * Parse an <code>XPathFilter2</code> type of <code>Transform</code>. - * + * * @param transformElem The <code>Transform</code> DOM element to parse. * @return The <code>Transform</code> API object representation of the - * <code>Transform</code> DOM element. - * @throws MOAApplicationException An error occurred parsing the - * <code>Transform</code> DOM element. + * <code>Transform</code> DOM element. + * @throws MOAApplicationException An error occurred parsing the + * <code>Transform</code> DOM element. */ private Transform parseXPathFilter2Transform(Element transformElem) - throws MOAApplicationException { - List filters = new ArrayList(); - NodeIterator iter = - XPathUtils.selectNodeIterator(transformElem, XPATH2_XPATH); + throws MOAApplicationException { + final List filters = new ArrayList(); + final NodeIterator iter = + XPathUtils.selectNodeIterator(transformElem, XPATH2_XPATH); Element filterElem; while ((filterElem = (Element) iter.nextNode()) != null) { - String filterAttr = filterElem.getAttribute("Filter"); + final String filterAttr = filterElem.getAttribute("Filter"); String filterType; String expression; Map nsDecls; @@ -247,17 +240,17 @@ public class TransformParser { /** * Parse an <code>XSLT</code> type of <code>Transform</code>. - * + * * @param transformElem The <code>Transform</code> DOM element to parse. * @return The <code>Transform</code> API object representation of the - * <code>Transform</code> DOM element. - * @throws MOAApplicationException An error occurred parsing the - * <code>Transform</code> DOM element. + * <code>Transform</code> DOM element. + * @throws MOAApplicationException An error occurred parsing the + * <code>Transform</code> DOM element. */ private Transform parseXSLTTransform(Element transformElem) - throws MOAApplicationException { - Element xsltElem = - (Element) XPathUtils.selectSingleNode(transformElem, XSLT_ELEMENT_XPATH); + throws MOAApplicationException { + final Element xsltElem = + (Element) XPathUtils.selectSingleNode(transformElem, XSLT_ELEMENT_XPATH); if (xsltElem == null) { throw new MOAApplicationException("2215", null); 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 cb07b34..bcab978 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 @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.io.InputStream; @@ -39,7 +38,6 @@ 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; @@ -49,7 +47,7 @@ import at.gv.egovernment.moaspss.util.XPathUtils; /** * A parser to parse <code>VerifyCMSSignatureRequest</code> DOM trees into * <code>VerifyCMSSignatureRequest</code> API objects. - * + * * @author Patrick Peck * @version $Id$ */ @@ -63,7 +61,7 @@ public class VerifyCMSSignatureRequestParser { 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"; @@ -72,110 +70,109 @@ public class VerifyCMSSignatureRequestParser { private static final String EXCLUDEBYTERANGE_FROM_XPATH = MOA + "ExcludedByteRange/" + MOA + "From"; private static final String EXCLUDEBYTERANGE_TO_XPATH = MOA + "ExcludedByteRange/" + MOA + "To"; - /** The <code>SPSSFactory</code> for creating new API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); + private final SPSSFactory factory = SPSSFactory.getInstance(); /** - * Parse a <code>VerifyCMSSignatureRequest</code> DOM element, as defined - * by the MOA schema. - * + * Parse a <code>VerifyCMSSignatureRequest</code> DOM element, as defined by the + * MOA schema. + * * @param requestElem The <code>VerifyCMSSignatureRequest</code> to parse. The - * request must have been successfully parsed against the schema for this - * method to succeed. - * @return A <code>VerifyCMSSignatureRequest</code> API objects containing - * the data from the DOM element. + * request must have been successfully parsed against the + * schema for this method to succeed. + * @return A <code>VerifyCMSSignatureRequest</code> API objects containing the + * data from the DOM element. * @throws MOAApplicationException An error occurred parsing the request. */ public VerifyCMSSignatureRequest parsePDF(Element requestElem) - throws MOAApplicationException { - - int[] signatories = parseSignatories(requestElem); - Date dateTime = - RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); - boolean extendedValidation = - RequestParserUtils.parseExtendedValidation(requestElem, EXTENDED_VALIDATION_XPATH, false); - - String cmsSignatureStr = - 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); + throws MOAApplicationException { + + final int[] signatories = parseSignatories(requestElem); + final Date dateTime = + RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); + final boolean extendedValidation = + RequestParserUtils.parseExtendedValidation(requestElem, EXTENDED_VALIDATION_XPATH, false); + + final String cmsSignatureStr = + XPathUtils.getElementValue(requestElem, PDF_SIGNATURE_XPATH, ""); + final CMSDataObject dataObject = parseDataObject(requestElem); + final String trustProfileID = + XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); + // Logger.info("CMSSignature: " + cmsSignatureStr); + final InputStream cmsSignature = + Base64Utils.decodeToStream(cmsSignatureStr, true); return factory.createVerifyCMSSignatureRequest( - signatories, - dateTime, - cmsSignature, - dataObject, - trustProfileID, - true, - extendedValidation); + signatories, + dateTime, + cmsSignature, + dataObject, + trustProfileID, + true, + extendedValidation); } - + /** - * Parse a <code>VerifyCMSSignatureRequest</code> DOM element, as defined - * by the MOA schema. - * + * Parse a <code>VerifyCMSSignatureRequest</code> DOM element, as defined by the + * MOA schema. + * * @param requestElem The <code>VerifyCMSSignatureRequest</code> to parse. The - * request must have been successfully parsed against the schema for this - * method to succeed. - * @return A <code>VerifyCMSSignatureRequest</code> API objects containing - * the data from the DOM element. + * request must have been successfully parsed against the + * schema for this method to succeed. + * @return A <code>VerifyCMSSignatureRequest</code> API objects containing the + * data from the DOM element. * @throws MOAApplicationException An error occurred parsing the request. */ public VerifyCMSSignatureRequest parse(Element requestElem) - throws MOAApplicationException { - - int[] signatories = parseSignatories(requestElem); - Date dateTime = - RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); - boolean extendedValidation = - RequestParserUtils.parseExtendedValidation(requestElem, EXTENDED_VALIDATION_XPATH, false); - - String cmsSignatureStr = - XPathUtils.getElementValue(requestElem, CMS_SIGNATURE_XPATH, ""); - CMSDataObject dataObject = parseDataObject(requestElem); - String trustProfileID = - XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); - InputStream cmsSignature = - Base64Utils.decodeToStream(cmsSignatureStr, true); + throws MOAApplicationException { + + final int[] signatories = parseSignatories(requestElem); + final Date dateTime = + RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); + final boolean extendedValidation = + RequestParserUtils.parseExtendedValidation(requestElem, EXTENDED_VALIDATION_XPATH, false); + + final String cmsSignatureStr = + XPathUtils.getElementValue(requestElem, CMS_SIGNATURE_XPATH, ""); + final CMSDataObject dataObject = parseDataObject(requestElem); + final String trustProfileID = + XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); + final InputStream cmsSignature = + Base64Utils.decodeToStream(cmsSignatureStr, true); return factory.createVerifyCMSSignatureRequest( - signatories, - dateTime, - cmsSignature, - dataObject, - trustProfileID, - false, - extendedValidation); + signatories, + dateTime, + cmsSignature, + dataObject, + trustProfileID, + false, + extendedValidation); } /** - * Parse the <code>Signatories</code> attribute contained in the + * Parse the <code>Signatories</code> attribute contained in the * <code>VerifyCMSSignatureRequest</code> DOM element. - * + * * @param requestElem The <code>VerifyCMSSignatureRequest</code> DOM element. - * @return The signatories contained in the given - * <code>VerifyCMSSignatureRequest</code> DOM element. + * @return The signatories contained in the given + * <code>VerifyCMSSignatureRequest</code> DOM element. */ private int[] parseSignatories(Element requestElem) { - String signatoriesStr = requestElem.getAttribute("Signatories"); + final String signatoriesStr = requestElem.getAttribute("Signatories"); if ("all".equals(signatoriesStr)) { return VerifyCMSSignatureRequest.ALL_SIGNATORIES; } else { - StringTokenizer tokenizer = new StringTokenizer(signatoriesStr); - List signatoriesList = new ArrayList(); + final StringTokenizer tokenizer = new StringTokenizer(signatoriesStr); + final List signatoriesList = new ArrayList(); int[] signatories; // put the signatories into a List while (tokenizer.hasMoreTokens()) { try { signatoriesList.add(new Integer(tokenizer.nextToken())); - } catch (NumberFormatException e) { + } catch (final NumberFormatException e) { // this cannot occur if the request has been validated } } @@ -188,44 +185,47 @@ public class VerifyCMSSignatureRequestParser { } /** - * Parse a the <code>DataObject</code> DOM element contained in a given + * Parse a the <code>DataObject</code> DOM element contained in a given * <code>VerifyCMSSignatureRequest</code> DOM element. - * - * @param requestElem The <code>VerifyCMSSignatureRequest</code> DOM element - * to parse. - * @return The <code>CMSDataObject</code> API object containing the data - * from the <code>DataObject</code> DOM element. + * + * @param requestElem The <code>VerifyCMSSignatureRequest</code> DOM element to + * parse. + * @return The <code>CMSDataObject</code> API object containing the data from + * the <code>DataObject</code> DOM element. */ private CMSDataObject parseDataObject(Element requestElem) { - Element dataObjectElem = - (Element) XPathUtils.selectSingleNode(requestElem, DATA_OBJECT_XPATH); + final Element dataObjectElem = + (Element) XPathUtils.selectSingleNode(requestElem, DATA_OBJECT_XPATH); if (dataObjectElem != null) { - Element metaInfoElem = - (Element) XPathUtils.selectSingleNode(dataObjectElem, META_INFO_XPATH); + final Element metaInfoElem = + (Element) XPathUtils.selectSingleNode(dataObjectElem, META_INFO_XPATH); MetaInfo metaInfo = null; - Element contentElem = - (Element) XPathUtils.selectSingleNode(dataObjectElem, CONTENT_XPATH); - CMSContent content = parseContent(contentElem); + final Element contentElem = + (Element) XPathUtils.selectSingleNode(dataObjectElem, CONTENT_XPATH); + final CMSContent content = parseContent(contentElem); if (metaInfoElem != null) { metaInfo = RequestParserUtils.parseMetaInfo(metaInfoElem); } - String excludeByteRangeFromStr = XPathUtils.getElementValue(dataObjectElem, EXCLUDEBYTERANGE_FROM_XPATH, null); - String excludeByteRangeToStr = XPathUtils.getElementValue(dataObjectElem, EXCLUDEBYTERANGE_TO_XPATH, null); - + final String excludeByteRangeFromStr = XPathUtils.getElementValue(dataObjectElem, + EXCLUDEBYTERANGE_FROM_XPATH, null); + final String excludeByteRangeToStr = XPathUtils.getElementValue(dataObjectElem, + EXCLUDEBYTERANGE_TO_XPATH, null); + BigDecimal excludeByteRangeFrom = null; BigDecimal excludeByteRangeTo = null; - - if (excludeByteRangeFromStr != null) - excludeByteRangeFrom = new BigDecimal(excludeByteRangeFromStr); - if (excludeByteRangeToStr != null) - excludeByteRangeTo = new BigDecimal(excludeByteRangeToStr); + + if (excludeByteRangeFromStr != null) { + excludeByteRangeFrom = new BigDecimal(excludeByteRangeFromStr); + } + if (excludeByteRangeToStr != null) { + excludeByteRangeTo = new BigDecimal(excludeByteRangeToStr); + } return factory.createCMSDataObject(metaInfo, content, excludeByteRangeFrom, excludeByteRangeTo); - - + } else { return null; } @@ -233,25 +233,25 @@ public class VerifyCMSSignatureRequestParser { } /** - * Parse the content contained in a <code>CMSContentBaseType</code> kind of - * DOM element. - * + * Parse the content contained in a <code>CMSContentBaseType</code> kind of DOM + * element. + * * @param contentElem The <code>CMSContentBaseType</code> kind of element to - * parse. - * @return A <code>CMSDataObject</code> API object containing the data - * from the given DOM element. + * parse. + * @return A <code>CMSDataObject</code> API object containing the data from the + * given DOM element. */ private CMSContent parseContent(Element contentElem) { - Element base64ContentElem = - (Element) XPathUtils.selectSingleNode(contentElem, BASE64_CONTENT_XPATH); + final Element base64ContentElem = + (Element) XPathUtils.selectSingleNode(contentElem, BASE64_CONTENT_XPATH); if (base64ContentElem != null) { - String base64Str = DOMUtils.getText(base64ContentElem); - InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); + final String base64Str = DOMUtils.getText(base64ContentElem); + final InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); return factory.createCMSContent(binaryContent); } else { return factory.createCMSContent( - contentElem.getAttribute("Reference")); + contentElem.getAttribute("Reference")); } } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java index de39948..265d0f3 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java @@ -21,13 +21,10 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.util.Iterator; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; -import at.gv.egovernment.moaspss.util.Constants; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -38,137 +35,138 @@ import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElemen import at.gv.egovernment.moa.spss.api.common.CheckResult; import at.gv.egovernment.moa.spss.api.common.SignerInfo; import at.gv.egovernment.moa.spss.api.xmlverify.AdESFormResults; +import at.gv.egovernment.moaspss.util.Constants; /** - * Convert a <code>VerifyCMSSignatureResponse</code> API object into its - * XML representation, according to the MOA XML schema. - * + * Convert a <code>VerifyCMSSignatureResponse</code> API object into its XML + * representation, according to the MOA XML schema. + * * @author Patrick Peck * @version $Id$ */ public class VerifyCMSSignatureResponseBuilder { /** The XML document containing the response element. */ - private Document responseDoc; + private final Document responseDoc; /** The response <code>VerifyCMSSignatureResponse</code> DOM element. */ - private Element responseElem; + private final Element responseElem; private boolean includeSigningTime = false; /** * Create a new <code>VerifyCMSSignatureResponseBuilder</code>: - * - * @throws MOASystemException An error occurred setting up the resulting - * XML document. + * + * @throws MOASystemException An error occurred setting up the resulting XML + * document. */ public VerifyCMSSignatureResponseBuilder() throws MOASystemException { responseDoc = - ResponseBuilderUtils.createResponse("VerifyCMSSignatureResponse"); + ResponseBuilderUtils.createResponse("VerifyCMSSignatureResponse"); responseElem = responseDoc.getDocumentElement(); } - public VerifyCMSSignatureResponseBuilder(Document responseDoc, String name, boolean includeSigningTime) throws MOASystemException { - this.responseDoc = responseDoc; - responseElem = responseDoc.createElementNS(Constants.MOA_NS_URI, name); - this.includeSigningTime = includeSigningTime; - } + public VerifyCMSSignatureResponseBuilder(Document responseDoc, String name, boolean includeSigningTime) + throws MOASystemException { + this.responseDoc = responseDoc; + responseElem = responseDoc.createElementNS(Constants.MOA_NS_URI, name); + this.includeSigningTime = includeSigningTime; + } + + public Element buildElement(VerifyCMSSignatureResponse response) throws MOAApplicationException { + this.build(response); + return responseElem; + } - public Element buildElement(VerifyCMSSignatureResponse response) throws MOAApplicationException { - this.build(response); - return responseElem; - } - /** - * Build a document containing a <code>VerifyCMSSignatureResponse</code> - * DOM element being the XML representation of the given + * Build a document containing a <code>VerifyCMSSignatureResponse</code> DOM + * element being the XML representation of the given * <code>VerifyCMSSignatureResponse</code> API object. - * - * @param response The <code>VerifyCMSSignatureResponse</code> to convert - * to XML. - * @return A document containing the <code>VerifyCMSSignatureResponse</code> - * DOM element. + * + * @param response The <code>VerifyCMSSignatureResponse</code> to convert to + * XML. + * @return A document containing the <code>VerifyCMSSignatureResponse</code> DOM + * element. * @throws MOAApplicationException An error occurred building the response. */ public Document build(VerifyCMSSignatureResponse response) - throws MOAApplicationException { + throws MOAApplicationException { Iterator iter; for (iter = response.getResponseElements().iterator(); iter.hasNext();) { - VerifyCMSSignatureResponseElement responseElement = - (VerifyCMSSignatureResponseElement) iter.next(); + final VerifyCMSSignatureResponseElement responseElement = + (VerifyCMSSignatureResponseElement) iter.next(); addResponseElement(responseElement); } - + return responseDoc; } /** * Add an element to the response. - * + * * @param responseElement The element to add to the response. * @throws MOAApplicationException An error occurred adding the element. */ private void addResponseElement(VerifyCMSSignatureResponseElement responseElement) - throws MOAApplicationException { + throws MOAApplicationException { + + final SignerInfo signerInfo = responseElement.getSignerInfo(); + final CheckResult signatureCheck = responseElement.getSignatureCheck(); + final CheckResult certCheck = responseElement.getCertificateCheck(); - SignerInfo signerInfo = responseElement.getSignerInfo(); - CheckResult signatureCheck = responseElement.getSignatureCheck(); - CheckResult certCheck = responseElement.getCertificateCheck(); - ResponseBuilderUtils.addSignerInfo( - responseDoc, - responseElem, - signerInfo.getSignerCertificate(), - signerInfo.isQualifiedCertificate(), - signerInfo.getQCSource(), - signerInfo.isPublicAuthority(), - signerInfo.getPublicAuhtorityID(), - signerInfo.isSSCD(), - signerInfo.getSSCDSource(), - signerInfo.getIssuerCountryCode(), - signerInfo.getTslInfos()); - - if(this.includeSigningTime) { + responseDoc, + responseElem, + signerInfo.getSignerCertificate(), + signerInfo.isQualifiedCertificate(), + signerInfo.getQCSource(), + signerInfo.isPublicAuthority(), + signerInfo.getPublicAuhtorityID(), + signerInfo.isSSCD(), + signerInfo.getSSCDSource(), + signerInfo.getIssuerCountryCode(), + signerInfo.getTslInfos()); + + if (this.includeSigningTime) { ResponseBuilderUtils.addSigningTime(responseDoc, - responseElem, signerInfo.getSigningTime()); + responseElem, signerInfo.getSigningTime()); } ResponseBuilderUtils.addSignatureAlgorithm(responseDoc, - responseElem, - responseElement.getSignatureAlgorithm()); - - + responseElem, + responseElement.getSignatureAlgorithm()); + ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "SignatureCheck", - signatureCheck.getCode(), - signatureCheck.getInfo()); + responseDoc, + responseElem, + "SignatureCheck", + signatureCheck.getCode(), + signatureCheck.getInfo()); ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "CertificateCheck", - certCheck.getCode(), - certCheck.getInfo()); - + responseDoc, + responseElem, + "CertificateCheck", + certCheck.getCode(), + certCheck.getInfo()); if (responseElement.getAdESFormResults() != null) { - Iterator formIterator = responseElement.getAdESFormResults().iterator(); - - while (formIterator.hasNext()) { - AdESFormResults adESFormResult = (AdESFormResults) formIterator.next(); - // add the CertificateCheck - ResponseBuilderUtils.addFormCheckElement(responseDoc, responseElem, "FormCheckResult", - adESFormResult.getCode().intValue(), adESFormResult.getName()); - - } - } - - if(responseElement.getExtendedCertificateCheck() != null) { - ResponseBuilderUtils.addExtendendResult(responseDoc, responseElem, responseElement.getExtendedCertificateCheck()); - } - + final Iterator formIterator = responseElement.getAdESFormResults().iterator(); + + while (formIterator.hasNext()) { + final AdESFormResults adESFormResult = (AdESFormResults) formIterator.next(); + // add the CertificateCheck + ResponseBuilderUtils.addFormCheckElement(responseDoc, responseElem, "FormCheckResult", + adESFormResult.getCode().intValue(), adESFormResult.getName()); + + } + } + + if (responseElement.getExtendedCertificateCheck() != null) { + ResponseBuilderUtils.addExtendendResult(responseDoc, responseElem, responseElement + .getExtendedCertificateCheck()); + } + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyPDFSignatureResponseBuilder.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyPDFSignatureResponseBuilder.java index 499f514..b9b7d26 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyPDFSignatureResponseBuilder.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyPDFSignatureResponseBuilder.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlbind; import java.util.Iterator; @@ -39,145 +38,144 @@ import at.gv.egovernment.moa.spss.api.xmlverify.AdESFormResults; import at.gv.egovernment.moaspss.logging.Logger; /** - * Convert a <code>VerifyCMSSignatureResponse</code> API object into its - * XML representation, according to the MOA XML schema. - * + * Convert a <code>VerifyCMSSignatureResponse</code> API object into its XML + * representation, according to the MOA XML schema. + * * @author Patrick Peck * @version $Id$ */ public class VerifyPDFSignatureResponseBuilder { /** The XML document containing the response element. */ - private Document responseDoc; + private final Document responseDoc; /** The response <code>VerifyCMSSignatureResponse</code> DOM element. */ - private Element responseRootElem; + private final Element responseRootElem; /** * Create a new <code>VerifyCMSSignatureResponseBuilder</code>: - * - * @throws MOASystemException An error occurred setting up the resulting - * XML document. + * + * @throws MOASystemException An error occurred setting up the resulting XML + * document. */ public VerifyPDFSignatureResponseBuilder() throws MOASystemException { responseDoc = - ResponseBuilderUtils.createResponse("VerifyPDFSignatureResponse"); + ResponseBuilderUtils.createResponse("VerifyPDFSignatureResponse"); responseRootElem = responseDoc.getDocumentElement(); } - + /** - * Build a document containing a <code>VerifyCMSSignatureResponse</code> - * DOM element being the XML representation of the given + * Build a document containing a <code>VerifyCMSSignatureResponse</code> DOM + * element being the XML representation of the given * <code>VerifyCMSSignatureResponse</code> API object. - * - * @param response The <code>VerifyCMSSignatureResponse</code> to convert - * to XML. - * @return A document containing the <code>VerifyCMSSignatureResponse</code> - * DOM element. + * + * @param response The <code>VerifyCMSSignatureResponse</code> to convert to + * XML. + * @return A document containing the <code>VerifyCMSSignatureResponse</code> DOM + * element. * @throws MOAApplicationException An error occurred building the response. */ public Document build(VerifyCMSSignatureResponse response) - throws MOAApplicationException { + throws MOAApplicationException { Iterator iter; - for (iter = response.getResponseElements().iterator(); iter.hasNext();) { - VerifyCMSSignatureResponseElement responseElement = - (VerifyCMSSignatureResponseElement) iter.next(); - Element signatureResult = ResponseBuilderUtils.addChildElement("SignatureResult", responseDoc, responseRootElem); + final VerifyCMSSignatureResponseElement responseElement = + (VerifyCMSSignatureResponseElement) iter.next(); + final Element signatureResult = ResponseBuilderUtils.addChildElement("SignatureResult", responseDoc, + responseRootElem); addResponseElement(responseElement, signatureResult); - + } - + return responseDoc; } /** * Add an element to the response. - * + * * @param responseElement The element to add to the response. - * @param signatureResult + * @param signatureResult * @throws MOAApplicationException An error occurred adding the element. */ private void addResponseElement(VerifyCMSSignatureResponseElement responseElement, Element responseElem) - throws MOAApplicationException { + throws MOAApplicationException { + + final SignerInfo signerInfo = responseElement.getSignerInfo(); + final CheckResult signatureCheck = responseElement.getSignatureCheck(); + final CheckResult certCheck = responseElement.getCertificateCheck(); - SignerInfo signerInfo = responseElement.getSignerInfo(); - CheckResult signatureCheck = responseElement.getSignatureCheck(); - CheckResult certCheck = responseElement.getCertificateCheck(); - if (signerInfo != null) { - ResponseBuilderUtils.addSignerInfo( - responseDoc, - responseElem, - signerInfo.getSignerCertificate(), - signerInfo.isQualifiedCertificate(), - signerInfo.getQCSource(), - signerInfo.isPublicAuthority(), - signerInfo.getPublicAuhtorityID(), - signerInfo.isSSCD(), - signerInfo.getSSCDSource(), - signerInfo.getIssuerCountryCode(), - signerInfo.getTslInfos()); - - ResponseBuilderUtils.addSigningTime(responseDoc, - responseElem, - signerInfo.getSigningTime()); - - + ResponseBuilderUtils.addSignerInfo( + responseDoc, + responseElem, + signerInfo.getSignerCertificate(), + signerInfo.isQualifiedCertificate(), + signerInfo.getQCSource(), + signerInfo.isPublicAuthority(), + signerInfo.getPublicAuhtorityID(), + signerInfo.isSSCD(), + signerInfo.getSSCDSource(), + signerInfo.getIssuerCountryCode(), + signerInfo.getTslInfos()); + + ResponseBuilderUtils.addSigningTime(responseDoc, + responseElem, + signerInfo.getSigningTime()); + } else { - Logger.info("Find signature result with no 'SignerInfo'. Maybe a signature verification Failed"); - + Logger.info("Find signature result with no 'SignerInfo'. Maybe a signature verification Failed"); + } ResponseBuilderUtils.addSignatureAlgorithm(responseDoc, - responseElem, - responseElement.getSignatureAlgorithm()); - + responseElem, + responseElement.getSignatureAlgorithm()); + ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "SignatureCheck", - signatureCheck.getCode(), - signatureCheck.getInfo()); + responseDoc, + responseElem, + "SignatureCheck", + signatureCheck.getCode(), + signatureCheck.getInfo()); ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "CertificateCheck", - certCheck.getCode(), - certCheck.getInfo()); - + responseDoc, + responseElem, + "CertificateCheck", + certCheck.getCode(), + certCheck.getInfo()); if (responseElement.getAdESFormResults() != null) { - Iterator formIterator = responseElement.getAdESFormResults().iterator(); - - while (formIterator.hasNext()) { - AdESFormResults adESFormResult = (AdESFormResults) formIterator.next(); - // add the CertificateCheck - ResponseBuilderUtils.addFormCheckElement(responseDoc, responseElem, "FormCheckResult", - adESFormResult.getCode().intValue(), adESFormResult.getName()); - - } - } - - if(responseElement.getExtendedCertificateCheck() != null) { - ResponseBuilderUtils.addExtendendResult(responseDoc, responseElem, responseElement.getExtendedCertificateCheck()); - } - - - //add additional PDF signature properteis - if (responseElement.getCoversFullDocument() != null || - responseElement.getByteRangeOfSignature() != null) { - Element pdfSigProps = ResponseBuilderUtils.createAndAddChildElement(responseDoc, responseElem, "SignatureProperties"); - ResponseBuilderUtils.addSignatureCoversFullPDF(responseDoc, - pdfSigProps, - responseElement.getCoversFullDocument()); - ResponseBuilderUtils.addSignatureByteRange(responseDoc, - pdfSigProps, - responseElement.getByteRangeOfSignature()); + final Iterator formIterator = responseElement.getAdESFormResults().iterator(); + + while (formIterator.hasNext()) { + final AdESFormResults adESFormResult = (AdESFormResults) formIterator.next(); + // add the CertificateCheck + ResponseBuilderUtils.addFormCheckElement(responseDoc, responseElem, "FormCheckResult", + adESFormResult.getCode().intValue(), adESFormResult.getName()); + + } + } + + if (responseElement.getExtendedCertificateCheck() != null) { + ResponseBuilderUtils.addExtendendResult(responseDoc, responseElem, responseElement + .getExtendedCertificateCheck()); + } + + // add additional PDF signature properteis + if (responseElement.getCoversFullDocument() != null || + responseElement.getByteRangeOfSignature() != null) { + final Element pdfSigProps = ResponseBuilderUtils.createAndAddChildElement(responseDoc, responseElem, + "SignatureProperties"); + ResponseBuilderUtils.addSignatureCoversFullPDF(responseDoc, + pdfSigProps, + responseElement.getCoversFullDocument()); + ResponseBuilderUtils.addSignatureByteRange(responseDoc, + pdfSigProps, + responseElement.getByteRangeOfSignature()); } - + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java index f1bb1d7..1360c5f 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java @@ -51,236 +51,230 @@ import at.gv.egovernment.moaspss.util.XPathUtils; */ public class VerifyXMLSignatureRequestParser { - // - // XPath expressions for parsing parts of the request - // - private static final String MOA = Constants.MOA_PREFIX + ":"; - private static final String DATE_TIME_XPATH = MOA + "DateTime"; - private static final String EXTENDED_VALIDATION_XPATH = MOA + "ExtendedValidation"; - private static final String RETURN_HASH_INPUT_DATA_XPATH = MOA + "ReturnHashInputData"; - private static final String TRUST_PROFILE_ID_XPATH = MOA + "TrustProfileID"; - private static final String VERIFY_SIGNATURE_ENVIRONMENT_XPATH = MOA + "VerifySignatureInfo/" + MOA - + "VerifySignatureEnvironment"; - private static final String VERIFY_SIGNATURE_LOCATION_XPATH = MOA + "VerifySignatureInfo/" + MOA - + "VerifySignatureLocation"; - private static final String SUPPLEMENT_PROFILE_XPATH = MOA + "SupplementProfile | " + MOA + "SupplementProfileID"; - private static final String SIGNATURE_MANIFEST_CHECK_PARAMS_XPATH = MOA + "SignatureManifestCheckParams"; - private static final String VERIFY_TRANSFORMS_INFO_PROFILE_XPATH = (MOA + "VerifyTransformsInfoProfile | ") - + (MOA + "VerifyTransformsInfoProfileID"); - private static final String REFERENCE_INFO_XPATH = MOA + "ReferenceInfo"; - - /** The <code>SPSSFactory</code> for creating new API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); - - /** - * Parse a <code>VerifyXMLSignatureRequest</code> DOM element, as defined - * by the MOA schema. - * + // + // XPath expressions for parsing parts of the request + // + private static final String MOA = Constants.MOA_PREFIX + ":"; + private static final String DATE_TIME_XPATH = MOA + "DateTime"; + private static final String EXTENDED_VALIDATION_XPATH = MOA + "ExtendedValidation"; + private static final String RETURN_HASH_INPUT_DATA_XPATH = MOA + "ReturnHashInputData"; + private static final String TRUST_PROFILE_ID_XPATH = MOA + "TrustProfileID"; + private static final String VERIFY_SIGNATURE_ENVIRONMENT_XPATH = MOA + "VerifySignatureInfo/" + MOA + + "VerifySignatureEnvironment"; + private static final String VERIFY_SIGNATURE_LOCATION_XPATH = MOA + "VerifySignatureInfo/" + MOA + + "VerifySignatureLocation"; + private static final String SUPPLEMENT_PROFILE_XPATH = MOA + "SupplementProfile | " + MOA + + "SupplementProfileID"; + private static final String SIGNATURE_MANIFEST_CHECK_PARAMS_XPATH = MOA + "SignatureManifestCheckParams"; + private static final String VERIFY_TRANSFORMS_INFO_PROFILE_XPATH = MOA + "VerifyTransformsInfoProfile | " + + MOA + "VerifyTransformsInfoProfileID"; + private static final String REFERENCE_INFO_XPATH = MOA + "ReferenceInfo"; + + /** The <code>SPSSFactory</code> for creating new API objects. */ + private final SPSSFactory factory = SPSSFactory.getInstance(); + + /** + * Parse a <code>VerifyXMLSignatureRequest</code> DOM element, as defined by the + * MOA schema. + * * @param requestElem The <code>VerifyXMLSignatureRequest</code> to parse. The - * request must have been successfully parsed against the schema for this - * method to succeed. - * @return A <code>VerifyXMLSignatureRequest</code> API object containing - * the data from the DOM element. + * request must have been successfully parsed against the + * schema for this method to succeed. + * @return A <code>VerifyXMLSignatureRequest</code> API object containing the + * data from the DOM element. * @throws MOAApplicationException An error occurred parsing the request. */ public VerifyXMLSignatureRequest parse(Element requestElem) - throws MOAApplicationException { - - Date dateTime = - RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); - - boolean extendedValidation = - RequestParserUtils.parseExtendedValidation(requestElem, EXTENDED_VALIDATION_XPATH, false); - - VerifySignatureInfo verifySignatureInfo = - parseVerifySignatureInfo(requestElem); - List supplementProfiles = parseSupplementProfiles(requestElem); - SignatureManifestCheckParams signatureManifestCheckParams = - parseSignatureManifestCheckParams(requestElem); - boolean returnHashInputData = - XPathUtils.selectSingleNode(requestElem, RETURN_HASH_INPUT_DATA_XPATH) - != null; - String trustProfileID = - XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); + throws MOAApplicationException { + + final Date dateTime = + RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); + + final boolean extendedValidation = + RequestParserUtils.parseExtendedValidation(requestElem, EXTENDED_VALIDATION_XPATH, false); + + final VerifySignatureInfo verifySignatureInfo = + parseVerifySignatureInfo(requestElem); + final List supplementProfiles = parseSupplementProfiles(requestElem); + final SignatureManifestCheckParams signatureManifestCheckParams = + parseSignatureManifestCheckParams(requestElem); + final boolean returnHashInputData = + XPathUtils.selectSingleNode(requestElem, RETURN_HASH_INPUT_DATA_XPATH) != null; + final String trustProfileID = + XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); return factory.createVerifyXMLSignatureRequest( - dateTime, - verifySignatureInfo, - supplementProfiles, - signatureManifestCheckParams, - returnHashInputData, - trustProfileID, - extendedValidation); + dateTime, + verifySignatureInfo, + supplementProfiles, + signatureManifestCheckParams, + returnHashInputData, + trustProfileID, + extendedValidation); } - /** - * Parse the <code>VerifySignatureInfo</code> DOM element contained in the - * <code>VerifyXMLSignatureRequest</code> DOM element. - * - * @param requestElem - * The <code>VerifyXMLSignatureRequest</code> DOM element - * containing the <code>VerifySignatureInfo</code> DOM element. - * @return The <code>VerifySignatureInfo</code> API object containing the - * data from the DOM element. - */ - private VerifySignatureInfo parseVerifySignatureInfo(Element requestElem) { - Element verifySignatureEnvironmentElem = (Element) XPathUtils.selectSingleNode(requestElem, - VERIFY_SIGNATURE_ENVIRONMENT_XPATH); - Content verifySignatureEnvironment = RequestParserUtils.parseContent(verifySignatureEnvironmentElem); - VerifySignatureLocation verifySignatureLocation = parseVerifySignatureLocation(requestElem); - - return factory.createVerifySignatureInfo(verifySignatureEnvironment, verifySignatureLocation); - } - - /** - * Parse the <code>VerifySignatureLocation</code> DOM element contained in - * the given <code>VerifyXMLSignatureRequest</code> DOM element. - * - * @param requestElem - * The <code>VerifyXMLSignatureRequst</code> DOM element. - * @return The <code>VerifySignatureLocation</code> API object containing - * the data from the DOM element. - */ - private VerifySignatureLocation parseVerifySignatureLocation(Element requestElem) { - Element locationElem = (Element) XPathUtils.selectSingleNode(requestElem, VERIFY_SIGNATURE_LOCATION_XPATH); - String xPathExpression = DOMUtils.getText(locationElem); - Map namespaceDeclarations = DOMUtils.getNamespaceDeclarations(locationElem); - - return factory.createVerifySignatureLocation(xPathExpression, namespaceDeclarations); - } - - /** - * Parse the supplement profiles contained in the given - * <code>VerifyXMLSignatureRequest</code> DOM element. - * - * @param requestElem - * The <code>VerifyXMLSignatureRequest</code> DOM element. - * @return A <code>List</code> of <code>SupplementProfile</code> API objects - * containing the data from the <code>SupplementProfile</code> DOM - * elements. - */ - private List parseSupplementProfiles(Element requestElem) { - List supplementProfiles = new ArrayList(); - NodeIterator profileElems = XPathUtils.selectNodeIterator(requestElem, SUPPLEMENT_PROFILE_XPATH); - Element profileElem; - - while ((profileElem = (Element) profileElems.nextNode()) != null) { - SupplementProfile profile; - - if ("SupplementProfile".equals(profileElem.getLocalName())) { - ProfileParser profileParser = new ProfileParser(); - profile = profileParser.parseSupplementProfile(profileElem); - } else { - String profileID = DOMUtils.getText(profileElem); - profile = factory.createSupplementProfile(profileID); - } - supplementProfiles.add(profile); - } - return supplementProfiles; - } - - /** - * Parse the <code>SignatureManifestCheckParams</code> DOM element contained - * in the given <code>VerifyXMLSignatureRequest</code> DOM element. - * - * @param requestElem - * The <code>VerifyXMLSignatureRequest</code> DOM element. - * @return The <code>SignatureManifestCheckParams</code> API object - * containing the data from the - * <code>SignatureManifestCheckParams</code> DOM element. - * @throws MOAApplicationException - * An error occurred parsing the - * <code>SignatureManifestCheckParams</code> DOM element. - */ - private SignatureManifestCheckParams parseSignatureManifestCheckParams(Element requestElem) - throws MOAApplicationException { - Element paramsElem = (Element) XPathUtils.selectSingleNode(requestElem, SIGNATURE_MANIFEST_CHECK_PARAMS_XPATH); - - if (paramsElem != null) { - String returnReferenceInputDataStr = paramsElem.getAttribute("ReturnReferenceInputData"); - boolean returnReferencInputData = BoolUtils.valueOf(returnReferenceInputDataStr); - List referenceInfos = parseReferenceInfos(paramsElem); - - return factory.createSignatureManifestCheckParams(referenceInfos, returnReferencInputData); - } else { - return null; - } - } - - /** - * Parse the <code>ReferenceInfo</code> DOM elements contained in a - * <code>SignatureManifestCheckParams</code> DOM element. - * - * @param paramsElem - * The <code>SignatureManifestCheckParams</code> DOM element - * containing the <code>ReferenceInfo</code> DOM elements. - * @return A <code>List</code> of <code>RefernceInfo</code> API objects - * containing the data from the <code>ReferenceInfo</code> DOM - * elements. - * @throws MOAApplicationException - * An error occurred parsing the <code>ReferenceInfo</code> DOM - * elements. - */ - private List parseReferenceInfos(Element paramsElem) throws MOAApplicationException { - - List referenceInfos = new ArrayList(); - NodeIterator refInfoElems = XPathUtils.selectNodeIterator(paramsElem, REFERENCE_INFO_XPATH); - Element refInfoElem; - - while ((refInfoElem = (Element) refInfoElems.nextNode()) != null) { - ReferenceInfo referenceInfo = parseReferenceInfo(refInfoElem); - - referenceInfos.add(referenceInfo); - } - - return referenceInfos; - } - - /** - * Parse a <code>ReferenceInfo</code> DOM element. - * - * @param refInfoElem - * The <code>ReferenceInfo</code> DOM element to parse. - * @return The <code>ReferenceInfo</code> API object containing the data - * from the given <code>ReferenceInfo</code> DOM element. - * @throws MOAApplicationException - * An error occurred parsing the <code>ReferenceInfo</code> DOM - * element. - */ - private ReferenceInfo parseReferenceInfo(Element refInfoElem) throws MOAApplicationException { - List profiles = parseVerifyTransformsInfoProfiles(refInfoElem); - return factory.createReferenceInfo(profiles); - } - - /** - * Parse the <code>VerifyTransformsInfoProfile</code> DOM elements contained - * in a <code>ReferenceInfo</code> DOM element. - * - * @param refInfoElem - * <code>ReferenceInfo</code> DOM element containing the - * <code>VerifyTransformsInfoProfile</code> DOM elements. - * @return A <code>List</code> of <code>VerifyTransformsInfoProfile</code> - * API objects containing the profile data. - * @throws MOAApplicationException - * An error occurred building the - * <code>VerifyTransformsInfoProfile</code>s. - */ - private List parseVerifyTransformsInfoProfiles(Element refInfoElem) throws MOAApplicationException { - - List profiles = new ArrayList(); - NodeIterator profileElems = XPathUtils.selectNodeIterator(refInfoElem, VERIFY_TRANSFORMS_INFO_PROFILE_XPATH); - Element profileElem; - - while ((profileElem = (Element) profileElems.nextNode()) != null) { - if ("VerifyTransformsInfoProfile".equals(profileElem.getLocalName())) { - ProfileParser profileParser = new ProfileParser(); - profiles.add(profileParser.parseVerifyTransformsInfoProfile(profileElem)); - } else { - String profileID = DOMUtils.getText(profileElem); - profiles.add(factory.createVerifyTransformsInfoProfile(profileID)); - } - } - return profiles; - } + /** + * Parse the <code>VerifySignatureInfo</code> DOM element contained in the + * <code>VerifyXMLSignatureRequest</code> DOM element. + * + * @param requestElem The <code>VerifyXMLSignatureRequest</code> DOM element + * containing the <code>VerifySignatureInfo</code> DOM + * element. + * @return The <code>VerifySignatureInfo</code> API object containing the data + * from the DOM element. + */ + private VerifySignatureInfo parseVerifySignatureInfo(Element requestElem) { + final Element verifySignatureEnvironmentElem = (Element) XPathUtils.selectSingleNode(requestElem, + VERIFY_SIGNATURE_ENVIRONMENT_XPATH); + final Content verifySignatureEnvironment = RequestParserUtils.parseContent( + verifySignatureEnvironmentElem); + final VerifySignatureLocation verifySignatureLocation = parseVerifySignatureLocation(requestElem); + + return factory.createVerifySignatureInfo(verifySignatureEnvironment, verifySignatureLocation); + } + + /** + * Parse the <code>VerifySignatureLocation</code> DOM element contained in the + * given <code>VerifyXMLSignatureRequest</code> DOM element. + * + * @param requestElem The <code>VerifyXMLSignatureRequst</code> DOM element. + * @return The <code>VerifySignatureLocation</code> API object containing the + * data from the DOM element. + */ + private VerifySignatureLocation parseVerifySignatureLocation(Element requestElem) { + final Element locationElem = (Element) XPathUtils.selectSingleNode(requestElem, + VERIFY_SIGNATURE_LOCATION_XPATH); + final String xPathExpression = DOMUtils.getText(locationElem); + final Map namespaceDeclarations = DOMUtils.getNamespaceDeclarations(locationElem); + + return factory.createVerifySignatureLocation(xPathExpression, namespaceDeclarations); + } + + /** + * Parse the supplement profiles contained in the given + * <code>VerifyXMLSignatureRequest</code> DOM element. + * + * @param requestElem The <code>VerifyXMLSignatureRequest</code> DOM element. + * @return A <code>List</code> of <code>SupplementProfile</code> API objects + * containing the data from the <code>SupplementProfile</code> DOM + * elements. + */ + private List parseSupplementProfiles(Element requestElem) { + final List supplementProfiles = new ArrayList(); + final NodeIterator profileElems = XPathUtils.selectNodeIterator(requestElem, SUPPLEMENT_PROFILE_XPATH); + Element profileElem; + + while ((profileElem = (Element) profileElems.nextNode()) != null) { + SupplementProfile profile; + + if ("SupplementProfile".equals(profileElem.getLocalName())) { + final ProfileParser profileParser = new ProfileParser(); + profile = profileParser.parseSupplementProfile(profileElem); + } else { + final String profileID = DOMUtils.getText(profileElem); + profile = factory.createSupplementProfile(profileID); + } + supplementProfiles.add(profile); + } + return supplementProfiles; + } + + /** + * Parse the <code>SignatureManifestCheckParams</code> DOM element contained in + * the given <code>VerifyXMLSignatureRequest</code> DOM element. + * + * @param requestElem The <code>VerifyXMLSignatureRequest</code> DOM element. + * @return The <code>SignatureManifestCheckParams</code> API object containing + * the data from the <code>SignatureManifestCheckParams</code> DOM + * element. + * @throws MOAApplicationException An error occurred parsing the + * <code>SignatureManifestCheckParams</code> DOM + * element. + */ + private SignatureManifestCheckParams parseSignatureManifestCheckParams(Element requestElem) + throws MOAApplicationException { + final Element paramsElem = (Element) XPathUtils.selectSingleNode(requestElem, + SIGNATURE_MANIFEST_CHECK_PARAMS_XPATH); + + if (paramsElem != null) { + final String returnReferenceInputDataStr = paramsElem.getAttribute("ReturnReferenceInputData"); + final boolean returnReferencInputData = BoolUtils.valueOf(returnReferenceInputDataStr); + final List referenceInfos = parseReferenceInfos(paramsElem); + + return factory.createSignatureManifestCheckParams(referenceInfos, returnReferencInputData); + } else { + return null; + } + } + + /** + * Parse the <code>ReferenceInfo</code> DOM elements contained in a + * <code>SignatureManifestCheckParams</code> DOM element. + * + * @param paramsElem The <code>SignatureManifestCheckParams</code> DOM element + * containing the <code>ReferenceInfo</code> DOM elements. + * @return A <code>List</code> of <code>RefernceInfo</code> API objects + * containing the data from the <code>ReferenceInfo</code> DOM elements. + * @throws MOAApplicationException An error occurred parsing the + * <code>ReferenceInfo</code> DOM elements. + */ + private List parseReferenceInfos(Element paramsElem) throws MOAApplicationException { + + final List referenceInfos = new ArrayList(); + final NodeIterator refInfoElems = XPathUtils.selectNodeIterator(paramsElem, REFERENCE_INFO_XPATH); + Element refInfoElem; + + while ((refInfoElem = (Element) refInfoElems.nextNode()) != null) { + final ReferenceInfo referenceInfo = parseReferenceInfo(refInfoElem); + + referenceInfos.add(referenceInfo); + } + + return referenceInfos; + } + + /** + * Parse a <code>ReferenceInfo</code> DOM element. + * + * @param refInfoElem The <code>ReferenceInfo</code> DOM element to parse. + * @return The <code>ReferenceInfo</code> API object containing the data from + * the given <code>ReferenceInfo</code> DOM element. + * @throws MOAApplicationException An error occurred parsing the + * <code>ReferenceInfo</code> DOM element. + */ + private ReferenceInfo parseReferenceInfo(Element refInfoElem) throws MOAApplicationException { + final List profiles = parseVerifyTransformsInfoProfiles(refInfoElem); + return factory.createReferenceInfo(profiles); + } + + /** + * Parse the <code>VerifyTransformsInfoProfile</code> DOM elements contained in + * a <code>ReferenceInfo</code> DOM element. + * + * @param refInfoElem <code>ReferenceInfo</code> DOM element containing the + * <code>VerifyTransformsInfoProfile</code> DOM elements. + * @return A <code>List</code> of <code>VerifyTransformsInfoProfile</code> API + * objects containing the profile data. + * @throws MOAApplicationException An error occurred building the + * <code>VerifyTransformsInfoProfile</code>s. + */ + private List parseVerifyTransformsInfoProfiles(Element refInfoElem) throws MOAApplicationException { + + final List profiles = new ArrayList(); + final NodeIterator profileElems = XPathUtils.selectNodeIterator(refInfoElem, + VERIFY_TRANSFORMS_INFO_PROFILE_XPATH); + Element profileElem; + + while ((profileElem = (Element) profileElems.nextNode()) != null) { + if ("VerifyTransformsInfoProfile".equals(profileElem.getLocalName())) { + final ProfileParser profileParser = new ProfileParser(); + profiles.add(profileParser.parseVerifyTransformsInfoProfile(profileElem)); + } else { + final String profileID = DOMUtils.getText(profileElem); + profiles.add(factory.createVerifyTransformsInfoProfile(profileID)); + } + } + return profiles; + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java index 0b73442..48206c9 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java @@ -32,10 +32,6 @@ import org.w3c.dom.DocumentFragment; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import at.gv.egovernment.moaspss.logging.Logger; -import at.gv.egovernment.moaspss.util.Base64Utils; -import at.gv.egovernment.moaspss.util.Constants; -import at.gv.egovernment.moaspss.util.MiscUtil; import at.gv.egovernment.moa.spss.MOAApplicationException; import at.gv.egovernment.moa.spss.MOASystemException; import at.gv.egovernment.moa.spss.api.common.Content; @@ -46,319 +42,315 @@ import at.gv.egovernment.moa.spss.api.xmlverify.AdESFormResults; import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.spss.server.config.ConfigurationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moaspss.util.Base64Utils; +import at.gv.egovernment.moaspss.util.Constants; +import at.gv.egovernment.moaspss.util.MiscUtil; /** * Convert a <code>VerifyXMLSignatureResponse</code> API object into its XML * representation, according to the MOA XML schema. - * + * * @author Patrick Peck * @version $Id$ */ public class VerifyXMLSignatureResponseBuilder { - private static final String MOA_NS_URI = Constants.MOA_NS_URI; - - /** The XML document containing the response element. */ - private Document responseDoc; - /** The response <code>VerifyXMLSignatureResponse</code> DOM element. */ - private Element responseElem; - - private boolean includeSigningTime = false; - /** - * Create a new <code>VerifyXMLSignatureResponseBuilder</code>: - * - * @throws MOASystemException - * An error occurred setting up the resulting XML document. - */ - public VerifyXMLSignatureResponseBuilder() throws MOASystemException { - responseDoc = ResponseBuilderUtils.createResponse("VerifyXMLSignatureResponse"); - responseElem = responseDoc.getDocumentElement(); - } - - public VerifyXMLSignatureResponseBuilder(boolean includeSigningTime) throws MOASystemException { - responseDoc = ResponseBuilderUtils.createResponse("VerifyXMLSignatureResponse"); - responseElem = responseDoc.getDocumentElement(); - this.includeSigningTime = includeSigningTime; - } - - public VerifyXMLSignatureResponseBuilder(Document responseDoc, String name, boolean includeSigningTime) throws MOASystemException { - this.responseDoc = responseDoc; - responseElem = responseDoc.createElementNS(MOA_NS_URI, name); - this.includeSigningTime = includeSigningTime; - } - - public Element buildElement(VerifyXMLSignatureResponse response) throws MOAApplicationException { - this.build(response); - return responseElem; - } - - /** - * Build a document containing a <code>VerifyXMLSignatureResponse</code> DOM - * element being the XML representation of the given - * <code>VerifyXMLSignatureResponse</code> API object. - * - * @param response - * The <code>VerifyXMLSignatureResponse</code> to convert to XML. - * @return A document containing the <code>VerifyXMLSignatureResponse</code> - * DOM element. - * @throws MOAApplicationException - * An error occurred building the response. - */ - public Document build(VerifyXMLSignatureResponse response) throws MOAApplicationException { - - Iterator iter; - List responseData; - - // add the SignerInfo - ResponseBuilderUtils.addSignerInfo(responseDoc, responseElem, response.getSignerInfo().getSignerCertificate(), - response.getSignerInfo().isQualifiedCertificate(), response.getSignerInfo().getQCSource(), - response.getSignerInfo().isPublicAuthority(), response.getSignerInfo().getPublicAuhtorityID(), - response.getSignerInfo().isSSCD(), response.getSignerInfo().getSSCDSource(), - response.getSignerInfo().getIssuerCountryCode(), - response.getSignerInfo().getTslInfos()); - - if(this.includeSigningTime) { - ResponseBuilderUtils.addSigningTime(responseDoc, - responseElem, response.getSignerInfo().getSigningTime()); - } - - // add HashInputData elements - responseData = response.getHashInputDatas(); - if (responseData != null && !responseData.isEmpty()) { - for (iter = responseData.iterator(); iter.hasNext();) { - InputData inputData = (InputData) iter.next(); - addContent("HashInputData", inputData); - } - } - - // add ReferenceInputData elements - responseData = response.getReferenceInputDatas(); - if (responseData != null && !responseData.isEmpty()) { - for (iter = responseData.iterator(); iter.hasNext();) { - InputData inputData = (InputData) iter.next(); - addContent("ReferenceInputData", inputData); - } - } - - //add hash algorithm - ResponseBuilderUtils.addSignatureAlgorithm(responseDoc, responseElem, response.getSignatureAlgorithm()); - - // add the SignatureCheck - addReferencesCheckResult("SignatureCheck", response.getSignatureCheck()); - - // add the SignatureManifestCheck - if (response.getSignatureManifestCheck() != null) { - addReferencesCheckResult("SignatureManifestCheck", response.getSignatureManifestCheck()); - } - - // add the XMLDsigManifestChecks - responseData = response.getXMLDsigManifestChecks(); - if (responseData != null && !responseData.isEmpty()) { - for (iter = responseData.iterator(); iter.hasNext();) { - ManifestRefsCheckResult checkResult = (ManifestRefsCheckResult) iter.next(); - addManifestRefsCheckResult("XMLDSIGManifestCheck", checkResult); - } - } - - // add the CertificateCheck - ResponseBuilderUtils.addCodeInfoElement(responseDoc, responseElem, "CertificateCheck", - response.getCertificateCheck().getCode(), response.getCertificateCheck().getInfo()); - - if (response.getAdESFormResults() != null) { - - Iterator formIterator = response.getAdESFormResults().iterator(); - - while (formIterator.hasNext()) { - AdESFormResults adESFormResult = (AdESFormResults) formIterator.next(); - // add the CertificateCheck - ResponseBuilderUtils.addFormCheckElement(responseDoc, responseElem, "FormCheckResult", - adESFormResult.getCode().intValue(), adESFormResult.getName()); - - } - } - - if(response.getExtendedCertificateCheck() != null) { - ResponseBuilderUtils.addExtendendResult(responseDoc, responseElem, response.getExtendedCertificateCheck()); - } - - return responseDoc; - } - - /** - * Add an element of type <code>ContentBaseType</code> to the response. - * - * @param elementName - * The name of the element. - * - * @param inputData - * The <code>InputData</code> to add. Based on the type of - * - * the <code>InputData</code>, either a - * <code>Base64Content</code> element or a - * <code>XMLContent</code> subelement will be added. An <code> - * InputDataBinaryImpl</code> will be added as a <code>Base64Content</code> - * child element. An<code>InputDataXMLImpl</code> will be added - * as <code> - * XMLContent</code> child element. - * - * @throws MOAApplicationException - * An error occurred adding the content. - */ - private void addContent(String elementName, InputData inputData) throws MOAApplicationException { - - Element contentElem = responseDoc.createElementNS(MOA_NS_URI, elementName); - - contentElem.setAttributeNS(null, "PartOf", inputData.getPartOf()); - if (inputData.getReferringReferenceNumber() != InputData.REFERER_NONE_) - contentElem.setAttributeNS(null, "ReferringSigReference", - Integer.toString(inputData.getReferringReferenceNumber())); - - if (MiscUtil.isNotEmpty(inputData.getHashAlgorithm())) { - contentElem.setAttribute("HashAlgorithm", inputData.getHashAlgorithm()); - - } - - switch (inputData.getContentType()) { - case Content.XML_CONTENT: - ContentXML contentXml = (ContentXML) inputData; - NodeList nodes = contentXml.getXMLContent(); - Element xmlElem; - int i; - - xmlElem = responseDoc.createElementNS(MOA_NS_URI, "XMLContent"); - // xmlElem.setAttributeNS(XML_NS_URI, "xml:space", "preserve"); - xmlElem.setAttribute("xml:space", "preserve"); - - for (i = 0; i < nodes.getLength(); i++) { - xmlElem.appendChild(responseDoc.importNode(nodes.item(i), true)); - } - contentElem.appendChild(xmlElem); - responseElem.appendChild(contentElem); - break; - case Content.BINARY_CONTENT: - Element binaryElem = responseDoc.createElementNS(MOA_NS_URI, "Base64Content"); - ContentBinary contentBinary = (ContentBinary) inputData; - String base64Str; - - try { - base64Str = Base64Utils.encode(contentBinary.getBinaryContent()); - } catch (IOException e) { - throw new MOAApplicationException("2200", null, e); - } - binaryElem.appendChild(responseDoc.createTextNode(base64Str)); - contentElem.appendChild(binaryElem); - responseElem.appendChild(contentElem); - break; - } - - } - - /** - * Add a <code>ReferencesCheckResult</code> to the response. - * - * @param elementName - * The DOM element name to use. - * @param checkResult - * The <code>ReferencesCheckResult</code> to add. - */ - private void addReferencesCheckResult(String elementName, ReferencesCheckResult checkResult) { - - NodeList info = null; - - if (checkResult.getInfo() != null) { - DocumentFragment fragment = responseDoc.createDocumentFragment(); - NodeList anyOtherInfo = checkResult.getInfo().getAnyOtherInfo(); - int[] failedReferences = checkResult.getInfo().getFailedReferences(); - - if (anyOtherInfo != null) { - addAnyOtherInfo(fragment, checkResult.getInfo().getAnyOtherInfo()); - } - - if (failedReferences != null) { - addFailedReferences(fragment, failedReferences); - } - - info = fragment.getChildNodes(); - } - - ResponseBuilderUtils.addCodeInfoElement(responseDoc, responseElem, elementName, checkResult.getCode(), info); - - } - - /** - * Add a <code>ManifestRefsCheckResult</code> to the response. - * - * @param elementName - * The DOM element name to use. - * @param checkResult - * The <code>ManifestRefsCheckResult</code> to add. - */ - private void addManifestRefsCheckResult(String elementName, ManifestRefsCheckResult checkResult) { - - DocumentFragment fragment = responseDoc.createDocumentFragment(); - NodeList anyOtherInfo = checkResult.getInfo().getAnyOtherInfo(); - int[] failedReferences = checkResult.getInfo().getFailedReferences(); - Element referringSigRefElem; - String referringSigRefStr; - - // add any other elements - if (anyOtherInfo != null) { - addAnyOtherInfo(fragment, checkResult.getInfo().getAnyOtherInfo()); - } - - // add the failed references - if (failedReferences != null) { - addFailedReferences(fragment, failedReferences); - } - - // add the ReferringSigReference - referringSigRefElem = responseDoc.createElementNS(MOA_NS_URI, "ReferringSigReference"); - referringSigRefStr = Integer.toString(checkResult.getInfo().getReferringSignatureReference()); - referringSigRefElem.appendChild(responseDoc.createTextNode(referringSigRefStr)); - fragment.appendChild(referringSigRefElem); - - // add XMLDSIGManifestCheckResult to the response - ResponseBuilderUtils.addCodeInfoElement(responseDoc, responseElem, elementName, checkResult.getCode(), - fragment.getChildNodes()); - } - - /** - * Add arbitrary XML content to a DOM <code>DocumentFragment</code>. - * - * @param fragment - * The fragment to add the XML content to. - * @param anyOtherInfo - * The XML content to add. - */ - private void addAnyOtherInfo(DocumentFragment fragment, NodeList anyOtherInfo) { - - int i; - - for (i = 0; i < anyOtherInfo.getLength(); i++) { - fragment.appendChild(responseDoc.importNode(anyOtherInfo.item(i), true)); - } - } - - /** - * Add the failed references as <code>FailedReference</code> DOM elements to - * the fragment. - * - * @param fragment - * The DOM document fragment to add the - * <code>FailedReference</code> elements to. - * @param failedReferences - * The indexes of the failed references. - */ - private void addFailedReferences(DocumentFragment fragment, int[] failedReferences) { - Element failedReferenceElem; - int i; - - for (i = 0; i < failedReferences.length; i++) { - failedReferenceElem = responseDoc.createElementNS(MOA_NS_URI, "FailedReference"); - failedReferenceElem.appendChild(responseDoc.createTextNode(Integer.toString(failedReferences[i]))); - fragment.appendChild(failedReferenceElem); - } - } + private static final String MOA_NS_URI = Constants.MOA_NS_URI; + + /** The XML document containing the response element. */ + private final Document responseDoc; + /** The response <code>VerifyXMLSignatureResponse</code> DOM element. */ + private final Element responseElem; + + private boolean includeSigningTime = false; + + /** + * Create a new <code>VerifyXMLSignatureResponseBuilder</code>: + * + * @throws MOASystemException An error occurred setting up the resulting XML + * document. + */ + public VerifyXMLSignatureResponseBuilder() throws MOASystemException { + responseDoc = ResponseBuilderUtils.createResponse("VerifyXMLSignatureResponse"); + responseElem = responseDoc.getDocumentElement(); + } + + public VerifyXMLSignatureResponseBuilder(boolean includeSigningTime) throws MOASystemException { + responseDoc = ResponseBuilderUtils.createResponse("VerifyXMLSignatureResponse"); + responseElem = responseDoc.getDocumentElement(); + this.includeSigningTime = includeSigningTime; + } + + public VerifyXMLSignatureResponseBuilder(Document responseDoc, String name, boolean includeSigningTime) + throws MOASystemException { + this.responseDoc = responseDoc; + responseElem = responseDoc.createElementNS(MOA_NS_URI, name); + this.includeSigningTime = includeSigningTime; + } + + public Element buildElement(VerifyXMLSignatureResponse response) throws MOAApplicationException { + this.build(response); + return responseElem; + } + + /** + * Build a document containing a <code>VerifyXMLSignatureResponse</code> DOM + * element being the XML representation of the given + * <code>VerifyXMLSignatureResponse</code> API object. + * + * @param response The <code>VerifyXMLSignatureResponse</code> to convert to + * XML. + * @return A document containing the <code>VerifyXMLSignatureResponse</code> DOM + * element. + * @throws MOAApplicationException An error occurred building the response. + */ + public Document build(VerifyXMLSignatureResponse response) throws MOAApplicationException { + + Iterator iter; + List responseData; + + // add the SignerInfo + ResponseBuilderUtils.addSignerInfo(responseDoc, responseElem, response.getSignerInfo() + .getSignerCertificate(), + response.getSignerInfo().isQualifiedCertificate(), response.getSignerInfo().getQCSource(), + response.getSignerInfo().isPublicAuthority(), response.getSignerInfo().getPublicAuhtorityID(), + response.getSignerInfo().isSSCD(), response.getSignerInfo().getSSCDSource(), + response.getSignerInfo().getIssuerCountryCode(), + response.getSignerInfo().getTslInfos()); + + if (this.includeSigningTime) { + ResponseBuilderUtils.addSigningTime(responseDoc, + responseElem, response.getSignerInfo().getSigningTime()); + } + + // add HashInputData elements + responseData = response.getHashInputDatas(); + if (responseData != null && !responseData.isEmpty()) { + for (iter = responseData.iterator(); iter.hasNext();) { + final InputData inputData = (InputData) iter.next(); + addContent("HashInputData", inputData); + } + } + + // add ReferenceInputData elements + responseData = response.getReferenceInputDatas(); + if (responseData != null && !responseData.isEmpty()) { + for (iter = responseData.iterator(); iter.hasNext();) { + final InputData inputData = (InputData) iter.next(); + addContent("ReferenceInputData", inputData); + } + } + + // add hash algorithm + ResponseBuilderUtils.addSignatureAlgorithm(responseDoc, responseElem, response.getSignatureAlgorithm()); + + // add the SignatureCheck + addReferencesCheckResult("SignatureCheck", response.getSignatureCheck()); + + // add the SignatureManifestCheck + if (response.getSignatureManifestCheck() != null) { + addReferencesCheckResult("SignatureManifestCheck", response.getSignatureManifestCheck()); + } + + // add the XMLDsigManifestChecks + responseData = response.getXMLDsigManifestChecks(); + if (responseData != null && !responseData.isEmpty()) { + for (iter = responseData.iterator(); iter.hasNext();) { + final ManifestRefsCheckResult checkResult = (ManifestRefsCheckResult) iter.next(); + addManifestRefsCheckResult("XMLDSIGManifestCheck", checkResult); + } + } + + // add the CertificateCheck + ResponseBuilderUtils.addCodeInfoElement(responseDoc, responseElem, "CertificateCheck", + response.getCertificateCheck().getCode(), response.getCertificateCheck().getInfo()); + + if (response.getAdESFormResults() != null) { + + final Iterator formIterator = response.getAdESFormResults().iterator(); + + while (formIterator.hasNext()) { + final AdESFormResults adESFormResult = (AdESFormResults) formIterator.next(); + // add the CertificateCheck + ResponseBuilderUtils.addFormCheckElement(responseDoc, responseElem, "FormCheckResult", + adESFormResult.getCode().intValue(), adESFormResult.getName()); + + } + } + + if (response.getExtendedCertificateCheck() != null) { + ResponseBuilderUtils.addExtendendResult(responseDoc, responseElem, response + .getExtendedCertificateCheck()); + } + + return responseDoc; + } + + /** + * Add an element of type <code>ContentBaseType</code> to the response. + * + * @param elementName The name of the element. + * + * @param inputData The <code>InputData</code> to add. Based on the type of + * + * the <code>InputData</code>, either a + * <code>Base64Content</code> element or a + * <code>XMLContent</code> subelement will be added. An + * <code> + * InputDataBinaryImpl</code> will be added as a <code>Base64Content</code> + * child element. An<code>InputDataXMLImpl</code> will be + * added as <code> + * XMLContent</code> child element. + * + * @throws MOAApplicationException An error occurred adding the content. + */ + private void addContent(String elementName, InputData inputData) throws MOAApplicationException { + + final Element contentElem = responseDoc.createElementNS(MOA_NS_URI, elementName); + + contentElem.setAttributeNS(null, "PartOf", inputData.getPartOf()); + if (inputData.getReferringReferenceNumber() != InputData.REFERER_NONE_) { + contentElem.setAttributeNS(null, "ReferringSigReference", + Integer.toString(inputData.getReferringReferenceNumber())); + } + + if (MiscUtil.isNotEmpty(inputData.getHashAlgorithm())) { + contentElem.setAttribute("HashAlgorithm", inputData.getHashAlgorithm()); + + } + + switch (inputData.getContentType()) { + case Content.XML_CONTENT: + final ContentXML contentXml = (ContentXML) inputData; + final NodeList nodes = contentXml.getXMLContent(); + Element xmlElem; + int i; + + xmlElem = responseDoc.createElementNS(MOA_NS_URI, "XMLContent"); + // xmlElem.setAttributeNS(XML_NS_URI, "xml:space", "preserve"); + xmlElem.setAttribute("xml:space", "preserve"); + + for (i = 0; i < nodes.getLength(); i++) { + xmlElem.appendChild(responseDoc.importNode(nodes.item(i), true)); + } + contentElem.appendChild(xmlElem); + responseElem.appendChild(contentElem); + break; + case Content.BINARY_CONTENT: + final Element binaryElem = responseDoc.createElementNS(MOA_NS_URI, "Base64Content"); + final ContentBinary contentBinary = (ContentBinary) inputData; + String base64Str; + + try { + base64Str = Base64Utils.encode(contentBinary.getBinaryContent()); + } catch (final IOException e) { + throw new MOAApplicationException("2200", null, e); + } + binaryElem.appendChild(responseDoc.createTextNode(base64Str)); + contentElem.appendChild(binaryElem); + responseElem.appendChild(contentElem); + break; + } + + } + + /** + * Add a <code>ReferencesCheckResult</code> to the response. + * + * @param elementName The DOM element name to use. + * @param checkResult The <code>ReferencesCheckResult</code> to add. + */ + private void addReferencesCheckResult(String elementName, ReferencesCheckResult checkResult) { + + NodeList info = null; + + if (checkResult.getInfo() != null) { + final DocumentFragment fragment = responseDoc.createDocumentFragment(); + final NodeList anyOtherInfo = checkResult.getInfo().getAnyOtherInfo(); + final int[] failedReferences = checkResult.getInfo().getFailedReferences(); + + if (anyOtherInfo != null) { + addAnyOtherInfo(fragment, checkResult.getInfo().getAnyOtherInfo()); + } + + if (failedReferences != null) { + addFailedReferences(fragment, failedReferences); + } + + info = fragment.getChildNodes(); + } + + ResponseBuilderUtils.addCodeInfoElement(responseDoc, responseElem, elementName, checkResult.getCode(), + info); + + } + + /** + * Add a <code>ManifestRefsCheckResult</code> to the response. + * + * @param elementName The DOM element name to use. + * @param checkResult The <code>ManifestRefsCheckResult</code> to add. + */ + private void addManifestRefsCheckResult(String elementName, ManifestRefsCheckResult checkResult) { + + final DocumentFragment fragment = responseDoc.createDocumentFragment(); + final NodeList anyOtherInfo = checkResult.getInfo().getAnyOtherInfo(); + final int[] failedReferences = checkResult.getInfo().getFailedReferences(); + Element referringSigRefElem; + String referringSigRefStr; + + // add any other elements + if (anyOtherInfo != null) { + addAnyOtherInfo(fragment, checkResult.getInfo().getAnyOtherInfo()); + } + + // add the failed references + if (failedReferences != null) { + addFailedReferences(fragment, failedReferences); + } + + // add the ReferringSigReference + referringSigRefElem = responseDoc.createElementNS(MOA_NS_URI, "ReferringSigReference"); + referringSigRefStr = Integer.toString(checkResult.getInfo().getReferringSignatureReference()); + referringSigRefElem.appendChild(responseDoc.createTextNode(referringSigRefStr)); + fragment.appendChild(referringSigRefElem); + + // add XMLDSIGManifestCheckResult to the response + ResponseBuilderUtils.addCodeInfoElement(responseDoc, responseElem, elementName, checkResult.getCode(), + fragment.getChildNodes()); + } + + /** + * Add arbitrary XML content to a DOM <code>DocumentFragment</code>. + * + * @param fragment The fragment to add the XML content to. + * @param anyOtherInfo The XML content to add. + */ + private void addAnyOtherInfo(DocumentFragment fragment, NodeList anyOtherInfo) { + + int i; + + for (i = 0; i < anyOtherInfo.getLength(); i++) { + fragment.appendChild(responseDoc.importNode(anyOtherInfo.item(i), true)); + } + } + + /** + * Add the failed references as <code>FailedReference</code> DOM elements to the + * fragment. + * + * @param fragment The DOM document fragment to add the + * <code>FailedReference</code> elements to. + * @param failedReferences The indexes of the failed references. + */ + private void addFailedReferences(DocumentFragment fragment, int[] failedReferences) { + Element failedReferenceElem; + int i; + + for (i = 0; i < failedReferences.length; i++) { + failedReferenceElem = responseDoc.createElementNS(MOA_NS_URI, "FailedReference"); + failedReferenceElem.appendChild(responseDoc.createTextNode(Integer.toString(failedReferences[i]))); + fragment.appendChild(failedReferenceElem); + } + } } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java index 4b40b9c..3b98dc4 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java @@ -21,13 +21,12 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; /** - * Base class for signature environment profile data used in XML signature + * Base class for signature environment profile data used in XML signature * creation. - * + * * @author Patrick Peck * @version $Id$ */ @@ -35,20 +34,20 @@ public interface CreateSignatureEnvironmentProfile { /** * Indicates that the profile data is given explicitly. */ - public static int EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE = 0; + int EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE = 0; /** - * Indicates that the profile data is stored in the configuration and resolved + * Indicates that the profile data is stored in the configuration and resolved * using an ID. */ - public static int ID_CREATESIGNATUREENVIRONMENTPROFILE = 1; - + int ID_CREATESIGNATUREENVIRONMENTPROFILE = 1; + /** * Gets the type of this object. - * - * @return The type of <code>CreateSignatureEnvironmentProfile</code> denoted - * by this object. Either - * <code>EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE</code> or - * <code>ID_CREATESIGNATUREENVIRONMENTPROFILE</code>. + * + * @return The type of <code>CreateSignatureEnvironmentProfile</code> denoted by + * this object. Either + * <code>EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE</code> or + * <code>ID_CREATESIGNATUREENVIRONMENTPROFILE</code>. */ - public int getCreateSignatureEnvironmentProfileType(); + int getCreateSignatureEnvironmentProfileType(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java index 0bce94c..5f761f1 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java @@ -21,34 +21,33 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import java.util.List; /** - * A <code>CreateSignatureEnvironmentProfile</code> containing the profile - * data explicitly. - * + * A <code>CreateSignatureEnvironmentProfile</code> containing the profile data + * explicitly. + * * @author Patrick Peck * @version $Id$ */ public interface CreateSignatureEnvironmentProfileExplicit - extends CreateSignatureEnvironmentProfile { - + extends CreateSignatureEnvironmentProfile { + /** * Gets the location and index of where to insert the signature into the * signature environment. - * - * @return The location and index of the signature in the signature - * environment. + * + * @return The location and index of the signature in the signature environment. */ - public CreateSignatureLocation getCreateSignatureLocation(); + CreateSignatureLocation getCreateSignatureLocation(); + /** * Gets the supplemental information. - * + * * @return The supplemental information. */ - public List getSupplements(); + List getSupplements(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java index 73e4f52..8066d37 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java @@ -21,24 +21,23 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; /** * A <code>CreateSignatureEnvironmentProfile</code> containing a profile ID * pointing to locally stored profile data. - * + * * @author Patrick Peck * @version $Id$ */ public interface CreateSignatureEnvironmentProfileID - extends CreateSignatureEnvironmentProfile { + extends CreateSignatureEnvironmentProfile { /** * Gets the profile ID. - * + * * @return The profile ID. */ - public String getCreateSignatureEnvironmentProfileID(); - + String getCreateSignatureEnvironmentProfileID(); + } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java index 9363408..e26ca1e 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import at.gv.egovernment.moa.spss.api.common.Content; /** * Encapsulates a signature object used during signature creation. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -39,11 +38,12 @@ public interface CreateSignatureInfo { * * @return The XML structure where the signature will be inserted. */ - public Content getCreateSignatureEnvironment(); + Content getCreateSignatureEnvironment(); + /** * Gets the supplemental data for the signature environment. * * @return The supplemental data for the signature envoronment. */ - public CreateSignatureEnvironmentProfile getCreateSignatureEnvironmentProfile(); + CreateSignatureEnvironmentProfile getCreateSignatureEnvironmentProfile(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java index 9a0b798..39a85b4 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java @@ -21,18 +21,17 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import at.gv.egovernment.moa.spss.api.common.ElementSelector; /** * Specifies where to insert the newly created signature. - * + * * An XPath expression is used to select the signature parent element. An - * additional index specifies the node index after which to insert the - * signature into the parent element. - * + * additional index specifies the node index after which to insert the signature + * into the parent element. + * * @author Patrick Peck * @version $Id$ */ @@ -40,8 +39,8 @@ public interface CreateSignatureLocation extends ElementSelector { /** * Gets the node index, after which the signature will be inserted into the * parent elemen. - * + * * @return The index of the node after which the signature will be inserted. */ - public int getIndex(); + int getIndex(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java index fbb0000..1793365 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import java.util.List; @@ -30,7 +29,7 @@ import at.gv.egovernment.moa.spss.api.common.MetaInfo; /** * Encapsulates information used for the transformation of the data object. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -38,14 +37,15 @@ import at.gv.egovernment.moa.spss.api.common.MetaInfo; public interface CreateTransformsInfo { /** * Gets the XMLDSig transforms. - * + * * @return A <code>List</code> of <code>Transform</code> objects. */ - public List getTransforms(); + List getTransforms(); + /** * Gets meta information about the data resulting from the transformation. - * + * * @return Meta information about the resulting data. */ - public MetaInfo getFinalDataMetaInfo(); + MetaInfo getFinalDataMetaInfo(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java index 5babdae..9832972 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; /** * Base class for transformation informations used in signature creation. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -35,18 +34,18 @@ public interface CreateTransformsInfoProfile { /** * Indicates transformation information given explicitly. */ - public static final int EXPLICIT_CREATETRANSFORMSINFOPROFILE = 0; + int EXPLICIT_CREATETRANSFORMSINFOPROFILE = 0; /** * Indicates transformation information given as an ID. */ - public static final int ID_CREATETRANSFORMSINFOPROFILE = 1; - + int ID_CREATETRANSFORMSINFOPROFILE = 1; + /** * Gets the type of profile information this object contains. - * + * * @return The type of transformation information, either - * <code>EXPLICIT_CREATETRANSFORMSINFOPROFILE</code> or - * <code>ID_CREATETRANSFORMSINFOPROFILE</code>. + * <code>EXPLICIT_CREATETRANSFORMSINFOPROFILE</code> or + * <code>ID_CREATETRANSFORMSINFOPROFILE</code>. */ - public int getCreateTransformsInfoProfileType(); + int getCreateTransformsInfoProfileType(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java index 9aae8cb..39580d6 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java @@ -21,30 +21,30 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import java.util.List; /** * Encapsulates explicit transformation informations. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ */ public interface CreateTransformsInfoProfileExplicit - extends CreateTransformsInfoProfile { + extends CreateTransformsInfoProfile { /** * Gets the transformation information of the data object. - * + * * @return Transformation information of the data object. */ - public CreateTransformsInfo getCreateTransformsInfo(); + CreateTransformsInfo getCreateTransformsInfo(); + /** * Gets the supplemental information. - * + * * @return The supplemental information. */ - public List getSupplements(); + List getSupplements(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java index 69c3629..fc9d869 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java @@ -21,22 +21,21 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; /** * Encapsulates transformation information given via an identifier. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ */ public interface CreateTransformsInfoProfileID - extends CreateTransformsInfoProfile { + extends CreateTransformsInfoProfile { /** * Gets the ID of the transformation. - * + * * @return The transformation profile ID. */ - public String getCreateTransformsInfoProfileID(); + String getCreateTransformsInfoProfileID(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java index 351b16e..0f8c8a2 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java @@ -21,15 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import java.util.List; - /** * Object that encapsulates a request to create an XML Signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -37,14 +35,15 @@ import java.util.List; public interface CreateXMLSignatureRequest { /** * Gets the identifier for the keys to be used for the signature. - * + * * @return The identifier for the keys to be used. */ - public String getKeyIdentifier(); + String getKeyIdentifier(); + /** - * Gets the information of the singleSignatureInfo elements. - * + * Gets the information of the singleSignatureInfo elements. + * * @return The information of singleSignatureInfo elements. */ - public List getSingleSignatureInfos(); + List getSingleSignatureInfos(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java index c1b1c30..1b59d7d 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java @@ -21,15 +21,14 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import java.util.List; /** - * Object that encapsulates the response on to a + * Object that encapsulates the response on to a * <code>CreateXMLSignatureRequest</code> to create an XML signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -37,8 +36,8 @@ import java.util.List; public interface CreateXMLSignatureResponse { /** * Gets the response elements. - * + * * @return The response elements. */ - public List getResponseElements(); + List getResponseElements(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java index b9bd334..fe6cbbb 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; /** - * Base class for <code>SignatureEnvironmentResponse</code> and - * <code>ErrorResponse</code> elements in a + * Base class for <code>SignatureEnvironmentResponse</code> and + * <code>ErrorResponse</code> elements in a * <code>CreateXMLSignatureResponse</code>. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -37,17 +36,18 @@ public interface CreateXMLSignatureResponseElement { /** * Indicates that this object contains a <code>SignatureEnvironment</code>. */ - public static final int SIGNATURE_ENVIRONMENT_RESPONSE = 0; + int SIGNATURE_ENVIRONMENT_RESPONSE = 0; /** * Indicates that this objet contains an <code>ErrorResponse</code>. */ - public static final int ERROR_RESPONSE = 1; - + int ERROR_RESPONSE = 1; + /** * Gets the type of response object. - * - * @return The type of response object, either - * <code>SIGNATURE_ENVIRONMENT_RESPONSE</code> or <code>ERROR_RESPONSE</code>. + * + * @return The type of response object, either + * <code>SIGNATURE_ENVIRONMENT_RESPONSE</code> or + * <code>ERROR_RESPONSE</code>. */ - public int getResponseType(); + int getResponseType(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java index 620e3b3..053ff00 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import at.gv.egovernment.moa.spss.api.common.Content; /** * Encapsulates information required to create a single signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -37,36 +36,39 @@ public interface DataObjectInfo { /** * Indicates that a detached signature will be created. */ - public static final String STRUCTURE_DETACHED = "detached"; + String STRUCTURE_DETACHED = "detached"; /** * Indicates that an enveloping signature will be created. */ - public static final String STRUCTURE_ENVELOPING = "enveloping"; + String STRUCTURE_ENVELOPING = "enveloping"; /** * Gets the structure of the signature. - * + * * @return The structure of the signature. */ - public String getStructure(); + String getStructure(); + /** - * Checks whether a refercence will be placed in the signature itself or - * in the manifest. - * + * Checks whether a refercence will be placed in the signature itself or in the + * manifest. + * * @return <code>true</code> if a reference will be placed in the manifest, - * <code>false</code> if it will be placed in the signature. + * <code>false</code> if it will be placed in the signature. */ - public boolean isChildOfManifest(); + boolean isChildOfManifest(); + /** * Gets information related to a single data object. - * + * * @return Information related to a single data object. */ - public Content getDataObject(); + Content getDataObject(); + /** * Gets information for the transformation of the data object. - * + * * @return The transformation information. */ - public CreateTransformsInfoProfile getCreateTransformsInfoProfile(); + CreateTransformsInfoProfile getCreateTransformsInfoProfile(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java index 6dfa843..d1b838d 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java @@ -21,13 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; - /** * Object containing detailed error information. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -35,14 +33,15 @@ package at.gv.egovernment.moa.spss.api.xmlsign; public interface ErrorResponse extends CreateXMLSignatureResponseElement { /** * Gets the error code. - * + * * @return The error code. */ - public int getErrorCode(); + int getErrorCode(); + /** * Gets verbose error information. - * + * * @return Verbose error information. */ - public String getInfo(); + String getInfo(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java index 47c4ce7..ecf57ce 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java @@ -21,24 +21,23 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import org.w3c.dom.Element; /** * Contains the signature if the signature creation was successful. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ */ public interface SignatureEnvironmentResponse - extends CreateXMLSignatureResponseElement { - /** + extends CreateXMLSignatureResponseElement { + /** * Gets the XML structure which contains the signature. - * + * * @return A general XML structure containing the signature. */ - public Element getSignatureEnvironment(); + Element getSignatureEnvironment(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java index 3355739..7b94bc0 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlsign; import java.util.List; /** * Encapsulates data to create a single signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,21 +35,23 @@ import java.util.List; public interface SingleSignatureInfo { /** * Gets the dataObjectInfo information. - * + * * @return The dataObjectInfo information. */ - public List getDataObjectInfos(); + List getDataObjectInfos(); + /** * Gets the signature object. - * + * * @return The signature object used during signature creation. */ - public CreateSignatureInfo getCreateSignatureInfo(); + CreateSignatureInfo getCreateSignatureInfo(); + /** * Check whether a Security Layer conform signature manifest will be created. - * - * @return <code>true</code>, if a Security Layer conform signature manifest - * will be created, <code>false</code> otherwise. + * + * @return <code>true</code>, if a Security Layer conform signature manifest + * will be created, <code>false</code> otherwise. */ - public boolean isSecurityLayerConform(); + boolean isSecurityLayerConform(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/AdESFormResults.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/AdESFormResults.java index e12c39b..2730c18 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/AdESFormResults.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/AdESFormResults.java @@ -1,7 +1,9 @@ package at.gv.egovernment.moa.spss.api.xmlverify; public interface AdESFormResults { - public Integer getCode(); - public String getInfo(); - public String getName(); + Integer getCode(); + + String getInfo(); + + String getName(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java index 8ff4617..6e5aeda 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java @@ -21,13 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; - /** * Contains the results of manifest checks according to XMLDsig. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -35,14 +33,15 @@ package at.gv.egovernment.moa.spss.api.xmlverify; public interface ManifestRefsCheckResult { /** * Gets the check code. - * + * * @return A numerical representation of the result of the manifest check. */ - public int getCode(); + int getCode(); + /** * Gets the reference to the manifest. - * + * * @return The reference to the manifest. */ - public ManifestRefsCheckResultInfo getInfo(); + ManifestRefsCheckResultInfo getInfo(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java index 4b0a4fb..f8973b2 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java @@ -21,23 +21,21 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; - /** * Encapsulates information referring to the manifest of the check. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ */ public interface ManifestRefsCheckResultInfo extends ReferencesCheckResultInfo { /** - * Gets the position of the signature reference containing the - * reference to the manifest being described by this object. - * + * Gets the position of the signature reference containing the reference to the + * manifest being described by this object. + * * @return The position of the signature reference. */ - public int getReferringSignatureReference(); + int getReferringSignatureReference(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java index 95a2b92..40bfe48 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import java.util.List; /** * Contains transformation parameters which are locally available. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,8 +35,8 @@ import java.util.List; public interface ReferenceInfo { /** * Gets the transformation info. - * + * * @return The transformation info. */ - public List getVerifyTransformsInfoProfiles(); + List getVerifyTransformsInfoProfiles(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java index dd1f482..bf41109 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java @@ -21,27 +21,27 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; /** - * Contains information about the verification status of references contained - * in the signature. - * + * Contains information about the verification status of references contained in + * the signature. + * * @author Patrick Peck * @version $Id$ */ public interface ReferencesCheckResult { /** * Gets the check code. - * + * * @return A numerical representation of the result of the reference check. */ - public int getCode(); + int getCode(); + /** * Gets the additional information about the result. - * + * * @return Additional information about the result. */ - public ReferencesCheckResultInfo getInfo(); + ReferencesCheckResultInfo getInfo(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java index fc87c98..2a2511e 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java @@ -21,29 +21,29 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import org.w3c.dom.NodeList; /** * Additional information contained in a <code>ReferencesCheckResult</code>. - * + * * @author Patrick Peck * @version $Id$ */ public interface ReferencesCheckResultInfo { /** * Gets the additional info of the failed <code>dsig:reference</code> element. - * + * * @return The info elements. */ - public NodeList getAnyOtherInfo(); + NodeList getAnyOtherInfo(); + /** * Gets the positions of the failed signature references containing the * references to the manifests being described by this object. - * - * @return The positions of the failed signature references. + * + * @return The positions of the failed signature references. */ - public int[] getFailedReferences(); + int[] getFailedReferences(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java index 524d4b8..d1e621e 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import java.util.List; /** * Contains parameters used to check the signature manifest. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,15 +35,16 @@ import java.util.List; public interface SignatureManifestCheckParams { /** * Gets the referential information. - * + * * @return The referential information. */ - public List getReferenceInfos(); + List getReferenceInfos(); + /** * Gets information on whether signature source data should be returned. - * + * * @return <code>true</code>, if signature source data should be returned, - * otherwise <code>false</code>. + * otherwise <code>false</code>. */ - public boolean getReturnReferenceInputData(); + boolean getReturnReferenceInputData(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java index 934e7c6..a906195 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; /** * Base class for supplementary information. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -35,18 +34,19 @@ public interface SupplementProfile { /** * Indicates that this object contains explicit supplementary information. */ - public static final int EXPLICIT_SUPPLEMENTPROFILE = 0; + int EXPLICIT_SUPPLEMENTPROFILE = 0; /** * Indicates that this object contains a profile id where supplementary * information can be found. */ - public static final int ID_SUPPLEMENTPROFILE = 1; + int ID_SUPPLEMENTPROFILE = 1; /** * Gets the type of supplementary information contained in this object. - * + * * @return The type of supplementary information contained in this object, - * either <code>EXPLICIT_SUPPLEMENT</code> or <code>ID_SUPPLEMENT</code>. + * either <code>EXPLICIT_SUPPLEMENT</code> or + * <code>ID_SUPPLEMENT</code>. */ - public int getSupplementProfileType(); + int getSupplementProfileType(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java index d01abec..e0da05d 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; /** * Encapsulates explicit supplementary information. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,8 +35,8 @@ import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; public interface SupplementProfileExplicit extends SupplementProfile { /** * Gets the supplemental object. - * + * * @return The supplemental object. */ - public XMLDataObjectAssociation getSupplementProfile(); + XMLDataObjectAssociation getSupplementProfile(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java index beeb2f0..b890c3a 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java @@ -21,22 +21,20 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; /** * Encapsulates supplementary information stored in a profile. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ */ public interface SupplementProfileID extends SupplementProfile { /** - * Gets the id of the profile where the supplementary information can be - * found. - * + * Gets the id of the profile where the supplementary information can be found. + * * @return The profile id. */ - public String getSupplementProfileID(); + String getSupplementProfileID(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java index 7ecd1b8..6eeb759 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java @@ -21,44 +21,44 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; /** - * Object encapsulating transform parameters either as a URI, binary or - * hashed. - * + * Object encapsulating transform parameters either as a URI, binary or hashed. + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ */ public interface TransformParameter { /** - * Indicates that this object contains a transform parameter given as - * a URI. + * Indicates that this object contains a transform parameter given as a URI. */ - public static final int URI_TRANSFORMPARAMETER = 0; + int URI_TRANSFORMPARAMETER = 0; /** * Indicates that this object contains binary transform parameter. */ - public static final int BINARY_TRANSFORMPARAMETER = 1; + int BINARY_TRANSFORMPARAMETER = 1; /** * Indicatest that this object contains a binary hash of the transform * parameter. */ - public static final int HASH_TRANSFORMPARAMETER = 2; - + int HASH_TRANSFORMPARAMETER = 2; + /** * Gets the type of transform parameter contained in this object. - * - * @return The type of transform parameter, being one of - * <code>URI_TRANSFORMPARAMETER</code>, <code>BINARY_TRANSFORMPARAMETER</code> - * or <code>HASH_TRANSFORMPARAMETER</code>. + * + * @return The type of transform parameter, being one of + * <code>URI_TRANSFORMPARAMETER</code>, + * <code>BINARY_TRANSFORMPARAMETER</code> or + * <code>HASH_TRANSFORMPARAMETER</code>. */ - public int getTransformParameterType(); + int getTransformParameterType(); + /** * Gets the transform parameter URI. - * + * * @return The transform parameter URI. */ - public String getURI();} + String getURI(); +} diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java index 388c5d0..afd3a89 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import java.io.InputStream; /** * Encapsulates a binary transform parameter. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,10 +35,10 @@ import java.io.InputStream; public interface TransformParameterBinary extends TransformParameter { /** * Gets the binary transform parameter. - * - * @return An <code>InputStream</code> from which the binary content can - * be read. + * + * @return An <code>InputStream</code> from which the binary content can be + * read. */ - public InputStream getBinaryContent(); + InputStream getBinaryContent(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java index 2ff6f39..11ad51e 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java @@ -21,13 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; - /** * Contains a hash of the transform parameter. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -35,16 +33,16 @@ package at.gv.egovernment.moa.spss.api.xmlverify; public interface TransformParameterHash extends TransformParameter { /** * Gets the method used for calculating the digest value. - * + * * @return The digest method. */ - public String getDigestMethod(); + String getDigestMethod(); + /** * Gets the binary hash of the transform parameter. - * + * * @return A binary representation of the hash. */ - public byte[] getDigestValue(); - + byte[] getDigestValue(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java index bc73e95..743ecb1 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; /** * Encapsulates a transform parameter given as a URI. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java index 5d6e0eb..f910747 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import at.gv.egovernment.moa.spss.api.common.Content; /** * Encapsulates a signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,16 +35,17 @@ import at.gv.egovernment.moa.spss.api.common.Content; public interface VerifySignatureInfo { /** * Gets the content of the <code>VerifySignatureEnvironment</code> element. - * - * @return A <code>MOAElement</code> containing the - * <code>VerifySignatureEnvironment</code> in a DOM-like structure. + * + * @return A <code>MOAElement</code> containing the + * <code>VerifySignatureEnvironment</code> in a DOM-like structure. */ - public Content getVerifySignatureEnvironment(); + Content getVerifySignatureEnvironment(); + /** * Gets the location of the signature. - * + * * @return The location of the signature within the signature environment. - */ - public VerifySignatureLocation getVerifySignatureLocation(); + */ + VerifySignatureLocation getVerifySignatureLocation(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java index 56a2567..8cd1d4a 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import at.gv.egovernment.moa.spss.api.common.ElementSelector; /** * Specifies where to find the signature to be verified. - * + * * @author Patrick Peck * @version $Id$ */ diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java index a55d55e..8a821d6 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; /** * Object for explicitly specifying a transformation path. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -35,18 +34,18 @@ public interface VerifyTransformsInfoProfile { /** * Indicates that this object contains the transformation path explicitly. */ - public static final int EXPLICIT_VERIFYTRANSFORMSINFOPROFILE = 0; + int EXPLICIT_VERIFYTRANSFORMSINFOPROFILE = 0; /** * Indicatest that this object contains a transformation info id. */ - public static final int ID_VERIFYTRANSFORMSINFOPROFILE = 1; - + int ID_VERIFYTRANSFORMSINFOPROFILE = 1; + /** * Gets the type of transformation information contained in this object. - * - * @return The type of transformation information, either - * <code>EXPLICIT_VERIFYTRANSFORMSINFOPROFILE</code> or - * <code>ID_VERIFYTRANSFORMSINFOPROFILE</code>. + * + * @return The type of transformation information, either + * <code>EXPLICIT_VERIFYTRANSFORMSINFOPROFILE</code> or + * <code>ID_VERIFYTRANSFORMSINFOPROFILE</code>. */ - public int getVerifyTransformsInfoProfileType(); + int getVerifyTransformsInfoProfileType(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java index cc29ace..bd91a28 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java @@ -21,14 +21,13 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import java.util.List; /** * Encapsulates explicit transformation information. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -36,14 +35,15 @@ import java.util.List; public interface VerifyTransformsInfoProfileExplicit extends VerifyTransformsInfoProfile { /** * Gets the XMLDSig transforms element. - * + * * @return The <code>List</code> of <code>Transform</code>s. */ - public List getTransforms(); + List getTransforms(); + /** * Gets the transformation parameters. - * + * * @return The transformation parameters. */ - public List getTransformParameters(); + List getTransformParameters(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java index eeb28da..ef083ba 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java @@ -21,12 +21,11 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; /** * Encapsulates transformation info id for signature verification. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -34,9 +33,9 @@ package at.gv.egovernment.moa.spss.api.xmlverify; public interface VerifyTransformsInfoProfileID extends VerifyTransformsInfoProfile { /** * Gets the identifier referencing the transformation info. - * + * * @return The identifier referencing the transformation info. */ - public String getVerifyTransformsInfoProfileID(); + String getVerifyTransformsInfoProfileID(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java index c4a0fd1..666164a 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java @@ -21,67 +21,70 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import java.util.Date; import java.util.List; - /** * Object that encapsulates a request to verify an XML signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ */ public interface VerifyXMLSignatureRequest { /** - * Gets the date and time for which the signature verification has to - * be performed. - * - * @return Date and time for which the signature verification has - * to be performed. + * Gets the date and time for which the signature verification has to be + * performed. + * + * @return Date and time for which the signature verification has to be + * performed. */ - public Date getDateTime(); + Date getDateTime(); + /** * Gets the signature to be verified. - * + * * @return The signature to be verified. */ - public VerifySignatureInfo getSignatureInfo(); + VerifySignatureInfo getSignatureInfo(); + /** * Gets the supplemental information. - * + * * @return The supplemental information. - */ - public List getSupplementProfiles(); + */ + List getSupplementProfiles(); + /** * Gets parameters for Security Layer signature verification. - * + * * @return Parameters for Security Layer signature verification. */ - public SignatureManifestCheckParams getSignatureManifestCheckParams(); + SignatureManifestCheckParams getSignatureManifestCheckParams(); + /** * Checks, whether actually signed data shall be returned. - * - * @return <code>true</code>, if signed data will be returned, - * otherwise <code>false</code>. + * + * @return <code>true</code>, if signed data will be returned, otherwise + * <code>false</code>. */ - public boolean getReturnHashInputData(); + boolean getReturnHashInputData(); + /** * Gets the profile id of the set of trusted certificates to be used for * signature verification. - * + * * @return The id of the trusted certificates. */ - public String getTrustProfileId(); - + String getTrustProfileId(); + /** * Should perform extended validation - * - * @return <code>true</code>, if signed data will be returned, - * otherwise <code>false</code>. + * + * @return <code>true</code>, if signed data will be returned, otherwise + * <code>false</code>. */ - public boolean getExtendedValidaiton(); + boolean getExtendedValidaiton(); } diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java index 0f42903..33fcf24 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api.xmlverify; import java.util.List; @@ -33,7 +32,7 @@ import at.gv.egovernment.moa.spss.api.common.SignerInfo; /** * Object that encapsulates the response on a request to verify an XML * signature. - * + * * @author Patrick Peck * @author Stephan Grill * @version $Id$ @@ -41,57 +40,63 @@ import at.gv.egovernment.moa.spss.api.common.SignerInfo; public interface VerifyXMLSignatureResponse { /** * Gets a <code>SignerInfo</code> element according to XMLDSig. - * + * * @return A <code>SignerInfo</code> element according to XMLDSig. */ - public SignerInfo getSignerInfo(); + SignerInfo getSignerInfo(); + /** * Gets datas signed by the signatory. - * + * * @return The signed datas. */ - public List getHashInputDatas(); + List getHashInputDatas(); + /** * Gets source datas elements. - * + * * @return The source datas elements. */ - public List getReferenceInputDatas(); + List getReferenceInputDatas(); + /** - * Gets the result of the signature verification. - * - * @return The result of the signature verification. - */ - public ReferencesCheckResult getSignatureCheck(); + * Gets the result of the signature verification. + * + * @return The result of the signature verification. + */ + ReferencesCheckResult getSignatureCheck(); + /** * Gets the result of the signature manifest verification. - * + * * @return The result of the signature manifest verification. */ - public ReferencesCheckResult getSignatureManifestCheck(); + ReferencesCheckResult getSignatureManifestCheck(); + /** * Gets XMLDSigManifestCheck elements. - * + * * @return The XMLDSigManifestCheck elements. */ - public List getXMLDsigManifestChecks(); + List getXMLDsigManifestChecks(); + /** * Gets the result of the certification verification. - * + * * @return The result of the certificate verification. */ - public CheckResult getCertificateCheck(); - + CheckResult getCertificateCheck(); + /** * Gets AdES Form results - * + * * This might be null! - * + * * @return The result of the AdES Form validation */ - public List getAdESFormResults(); - - public ExtendedCertificateCheckResult getExtendedCertificateCheck(); - - public String getSignatureAlgorithm(); + List getAdESFormResults(); + + ExtendedCertificateCheckResult getExtendedCertificateCheck(); + + String getSignatureAlgorithm(); } |