diff options
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/sig/signatureobject/SignatureObjectHelper.java | 50 |
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;
+ }
+}
|