aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag
diff options
context:
space:
mode:
authorknowcenter <knowcenter@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-06-01 08:33:42 +0000
committerknowcenter <knowcenter@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-06-01 08:33:42 +0000
commit5f5c03c5d8475add6e9ba7474de7a20970ccd7a7 (patch)
treed360a579d199db2beadc57d53f7e8170c6754132 /src/main/java/at/knowcenter/wag
parent50e12dc6d6683f60971a17851135a82eb5813084 (diff)
downloadpdf-as-3-5f5c03c5d8475add6e9ba7474de7a20970ccd7a7.tar.gz
pdf-as-3-5f5c03c5d8475add6e9ba7474de7a20970ccd7a7.tar.bz2
pdf-as-3-5f5c03c5d8475add6e9ba7474de7a20970ccd7a7.zip
solved the "SIG_NAME" fix
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@115 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/signatureobject/SignatureObjectHelper.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/signatureobject/SignatureObjectHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/signatureobject/SignatureObjectHelper.java
new file mode 100644
index 0000000..1eb432e
--- /dev/null
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/signatureobject/SignatureObjectHelper.java
@@ -0,0 +1,50 @@
+/**
+ *
+ */
+package at.knowcenter.wag.egov.egiz.sig.signatureobject;
+
+import at.knowcenter.wag.egov.egiz.PdfASID;
+import at.knowcenter.wag.egov.egiz.exceptions.InvalidIDException;
+import at.knowcenter.wag.egov.egiz.exceptions.SignatureException;
+import at.knowcenter.wag.egov.egiz.exceptions.SignatureTypesException;
+import at.knowcenter.wag.egov.egiz.sig.SignatureObject;
+import at.knowcenter.wag.egov.egiz.sig.connectors.bku.SignSignatureObject;
+
+/**
+ * Contains helper methods for dealing with signature objects.
+ *
+ * @author wprinz
+ *
+ */
+public final class SignatureObjectHelper
+{
+
+ public static SignatureObject convertSignSignatureObjectToSignatureObject (SignSignatureObject sso, String signature_type) throws SignatureTypesException, SignatureException
+ {
+ SignatureObject so = new SignatureObject();
+ so.setSigType(signature_type);
+ so.initByType();
+ so.setSignationDate(sso.getDate());
+ so.setSignationIssuer(sso.getIssuer());
+ so.setSignationSerialNumber(sso.getSerialNumber());
+ so.setSignationValue(sso.getSignatureValue());
+ so.setSignationIDs(sso.getSigID());
+ so.setKZ(new PdfASID(sso.getSigKZ()));
+ so.setSignationName(sso.getName());
+
+ return so;
+ }
+
+ public static SignSignatureObject convertSignatureObjectToSignSignatureObject (SignatureObject so) throws InvalidIDException
+ {
+ SignSignatureObject sso = new SignSignatureObject();
+ sso.date = so.getSignationDate();
+ sso.signatureValue = so.getSignationValue();
+ sso.issuer = so.getSignationIssuer();
+ sso.x509Certificate = so.getX509Cert().getX509Certificate();
+ sso.id = so.getSignationIds();
+ sso.kz = so.getKZ() == null ? null : so.getKZ().toString();
+
+ return sso;
+ }
+}