aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/PdfASID.java
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2013-01-09 15:41:29 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2013-01-09 15:41:29 +0000
commit535a04fa05f739ec16dd81666e3b0f82dfbd442d (patch)
tree0804f301c1a9ceb303a8441b7b29244fc8eb7ff0 /src/main/java/at/knowcenter/wag/egov/egiz/PdfASID.java
parent1efaf6fd5619dfa95c9d7e8c71eda4c2ffba4998 (diff)
downloadpdf-as-3-535a04fa05f739ec16dd81666e3b0f82dfbd442d.tar.gz
pdf-as-3-535a04fa05f739ec16dd81666e3b0f82dfbd442d.tar.bz2
pdf-as-3-535a04fa05f739ec16dd81666e3b0f82dfbd442d.zip
pdf-as-lib maven project files moved to pdf-as-lib
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/pdf-as/trunk@926 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/PdfASID.java')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/PdfASID.java222
1 files changed, 0 insertions, 222 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/PdfASID.java b/src/main/java/at/knowcenter/wag/egov/egiz/PdfASID.java
deleted file mode 100644
index ef9cb87..0000000
--- a/src/main/java/at/knowcenter/wag/egov/egiz/PdfASID.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria 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.
- *
- * $Id: PdfASID.java,v 1.1 2006/08/25 17:04:16 wprinz Exp $
- */
-package at.knowcenter.wag.egov.egiz;
-
-import java.io.Serializable;
-
-import at.gv.egiz.pdfas.exceptions.ErrorCode;
-import at.knowcenter.wag.egov.egiz.exceptions.InvalidIDException;
-import at.knowcenter.wag.egov.egiz.framework.SignatorFactory;
-
-/**
- * This class encapsulates the Pdf-AS ID ("Kennzeichnung") urn.
- *
- * @author wprinz
- */
-public class PdfASID implements Serializable
-{
-
- /**
- * SVUID.
- */
- private static final long serialVersionUID = 4776635173830445739L;
-
- /**
- * The urn word that leads in the identifier.
- */
- protected static final String URN = "urn";
-
- /**
- * The namespace of the urn.
- */
- protected static final String NAMESPACE = "pdfsigfilter";
-
- /**
- * The separator between urn blocks.
- */
- protected static final String SPLIT_STRING = ":";
-
- /**
- * The vendor.
- */
- protected String vendor = null;
-
- /**
- * The algorithm type.
- */
- protected String type = null;
-
- /**
- * The version of the algorithm.
- */
- protected String version = null;
-
- /**
- * Constructor that fills in the parameters directly.
- *
- * @param vendor
- * @param type
- * @param version
- */
- public PdfASID(String vendor, String type, String version)
- {
- set(vendor, type, version);
- }
-
- /**
- * Parses the given id String and throws an Exception if it is not valid.
- *
- * @param id
- * The id String to be parsed.
- */
- public PdfASID(String id) throws InvalidIDException
- {
- String[] tokens = id.split(SPLIT_STRING);
-
- if (tokens.length != 5)
- {
- throw new InvalidIDException(ErrorCode.UNABLE_TO_PARSE_ID, "The method doesn't have enough tokens (" + id + ")");
- }
-
- if (!tokens[0].equals(URN))
- {
- throw new InvalidIDException(ErrorCode.UNABLE_TO_PARSE_ID, "The method must start with " + URN + " (" + id + ")");
- }
-
- if (!tokens[1].equals(NAMESPACE))
- {
- throw new InvalidIDException(ErrorCode.UNABLE_TO_PARSE_ID, "The namespace of the method must be " + NAMESPACE + " (" + id + ")");
- }
-
- set(tokens[2], tokens[3], tokens[4]);
- }
-
- /**
- * Copy Constructor.
- *
- * @param other
- * The other PdfASID to copy the data from.
- */
- public PdfASID(final PdfASID other)
- {
- set(other.vendor, other.type, other.version);
- }
-
- /**
- * Auxiliary constructor.
- *
- * @param vendor
- * The vendor.
- * @param type
- * The type.
- * @param version
- * The version.
- */
- private void set(String vendor, String type, String version)
- {
- this.vendor = vendor;
- this.type = type;
- this.version = version;
- }
-
- /**
- * Returns the type.
- *
- * @return Returns the type.
- */
- public String getType()
- {
- return this.type;
- }
-
- /**
- * Returns the vendor.
- *
- * @return Returns the vendor.
- */
- public String getVendor()
- {
- return this.vendor;
- }
-
- /**
- * Returns the version.
- *
- * @return Returns the version.
- */
- public String getVersion()
- {
- return this.version;
- }
-
-
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- //@override
- public boolean equals(Object obj)
- {
- if (obj == null)
- {
- return false;
- }
- if (!(obj instanceof PdfASID))
- {
- return false;
- }
-
- PdfASID other = (PdfASID) obj;
-
- return this.toString().equals(other.toString());
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return URN + SPLIT_STRING + NAMESPACE + SPLIT_STRING + this.vendor + SPLIT_STRING + this.type + SPLIT_STRING + this.version;
- }
-
- /**
- * Returns if it is an old textual signature (pre 1.2.0) that used cp1252 encoding for text extraction (mostly)
- * @return
- */
- public boolean isOldCp1252Version() {
- return this.getVersion().equals(SignatorFactory.VERSION_1_0_0)
- || this.getVersion().equals(SignatorFactory.VERSION_1_1_0);
- }
-
-}