aboutsummaryrefslogtreecommitdiff
path: root/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java')
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java174
1 files changed, 174 insertions, 0 deletions
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java
new file mode 100644
index 000000000..310f2dd2b
--- /dev/null
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2003 Federal Chancellery Austria
+ * MOA-SPSS has been developed in a cooperation between BRZ, the Federal
+ * Chancellery Austria - ICT staff unit, and Graz University of Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+
+
+package at.gv.egovernment.moa.spss.server.iaik.xmlsign;
+
+import java.util.List;
+
+import iaik.server.modules.xmlsign.DataObjectTreatment;
+
+import at.gv.egovernment.moa.spss.server.util.IdGenerator;
+
+/**
+ * An object encapsulating how to treat an associated <code>DataObject</code>
+ * when creating a signature.
+ *
+ * @author Patrick Peck
+ * @version $Id$
+ */
+public class DataObjectTreatmentImpl implements DataObjectTreatment {
+ /** The final content MIME type. */
+ private String finalContentType;
+ /** The name of the hash algorithm. */
+ private String hashAlgorithmName;
+ /** This transformations to apply to the associated data object. */
+ private List transformationList;
+ /** Supplemental information for the transformations. */
+ private List transformationSupplements;
+ /** Whether to include the associated data object in the signature. */
+ private boolean includedInSignature;
+ /** Whether to include the associated data object in the manifest. */
+ private boolean referenceInManifest;
+ /** The object ID generator. */
+ private IdGenerator objIdGen;
+
+ /**
+ * Create a new <code>DataObjectTreatmentImpl</code>.
+ *
+ * @param objIdGen The <code>IdGenerator</code> for unique object IDs.
+ */
+ public DataObjectTreatmentImpl(IdGenerator objIdGen) {
+ this.objIdGen = objIdGen;
+ }
+
+ /**
+ * @see iaik.server.modules.xmlsign.DataObjectTreatment#getFinalContentType()
+ */
+ public String getFinalContentType() {
+ return finalContentType;
+ }
+
+ /**
+ * Sets the final content type.
+ *
+ * @param finalContentType The final content type to set (a MIME-type type of
+ * <code>String</code>).
+ */
+ public void setFinalContentType(String finalContentType) {
+ this.finalContentType = finalContentType;
+ }
+
+ /**
+ * @see iaik.server.modules.xmlsign.DataObjectTreatment#getHashAlgorithmName()
+ */
+ public String getHashAlgorithmName() {
+ return hashAlgorithmName;
+ }
+
+ /**
+ * Sets the hash algorithm name.
+ *
+ * @param hashAlgorithmName The hash algorithm name to set.
+ */
+ public void setHashAlgorithmName(String hashAlgorithmName) {
+ this.hashAlgorithmName = hashAlgorithmName;
+ }
+
+ /**
+ * @see iaik.server.modules.xmlsign.DataObjectTreatment#isIncludedInSignature()
+ */
+ public boolean isIncludedInSignature() {
+ return includedInSignature;
+ }
+
+ /**
+ * Sets whether the associated <code>DataObject</code> is to be included in
+ * the signature.
+ *
+ * @param includedInSignature If <code>true</code>, the associated
+ * <code>DataObject</code> will be included in the signature, otherwise not.
+ */
+ public void setIncludedInSignature(boolean includedInSignature) {
+ this.includedInSignature = includedInSignature;
+ }
+
+ /**
+ * @see iaik.server.modules.xmlsign.DataObjectTreatment#isReferenceInManifest()
+ */
+ public boolean isReferenceInManifest() {
+ return referenceInManifest;
+ }
+
+ /**
+ * Sets whether the associated <code>DataObject</code> is
+ * to be included in the <code>dsig:Manifest</code>.
+ *
+ * @param referenceInManifest If <code>true</code>, the associated
+ * <code>DataObject</code> will be included in the manifest, otherwise not.
+ */
+ public void setReferenceInManifest(boolean referenceInManifest) {
+ this.referenceInManifest = referenceInManifest;
+ }
+
+ /**
+ * @see iaik.server.modules.xmlsign.DataObjectTreatment#getTransformationList()
+ */
+ public List getTransformationList() {
+ return transformationList;
+ }
+
+ /**
+ * Set the list of transformations for the associated <code>DataObject</code>.
+ *
+ * @param transformationList The transformations to set.
+ */
+ public void setTransformationList(List transformationList) {
+ this.transformationList = transformationList;
+ }
+
+ /**
+ * @see iaik.server.modules.xmlsign.DataObjectTreatment#getTransformationSupplements()
+ */
+ public List getTransformationSupplements() {
+ return transformationSupplements;
+ }
+
+ /**
+ * Sets the transformation supplements for the associated
+ * <code>DataObject</code>.
+ *
+ * @param transformationSupplements The transformation supplements to set.
+ */
+ public void setTransformationSupplements(List transformationSupplements) {
+ this.transformationSupplements = transformationSupplements;
+ }
+
+ /**
+ * @see iaik.server.modules.xmlsign.DataObjectTreatment#getDsigDataObjectID()
+ */
+ public String getDsigDataObjectID() {
+ return objIdGen.uniqueId();
+ }
+
+}