]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/Certificate.java
FIX: add UTF-8 as charset where appropriate.
[gigi.git] / src / org / cacert / gigi / dbObjects / Certificate.java
index df940dbc06816cf33eaaf5151dbe343705e6af62..affb1719fe8ff58a44e4a7db41edd1260438e408 100644 (file)
@@ -206,7 +206,7 @@ public class Certificate {
 
     }
 
-    public CertificateStatus getStatus() {
+    public synchronized CertificateStatus getStatus() {
         if (id == 0) {
             return CertificateStatus.DRAFT;
         }
@@ -219,10 +219,10 @@ public class Certificate {
 
         crtName = rs.getString(1);
         serial = rs.getString(4);
-        if (rs.getTime(2) == null) {
+        if (rs.getTimestamp(2) == null) {
             return CertificateStatus.DRAFT;
         }
-        if (rs.getTime(2) != null && rs.getTime(3) == null) {
+        if (rs.getTimestamp(2) != null && rs.getTimestamp(3) == null) {
             return CertificateStatus.ISSUED;
         }
         return CertificateStatus.REVOKED;
@@ -274,7 +274,7 @@ public class Certificate {
         File csrFile = KeyStorage.locateCsr(id);
         csrName = csrFile.getPath();
         FileOutputStream fos = new FileOutputStream(csrFile);
-        fos.write(csr.getBytes());
+        fos.write(csr.getBytes("UTF-8"));
         fos.close();
 
         GigiPreparedStatement updater = DatabaseConnection.getInstance().prepare("UPDATE certs SET csr_name=? WHERE id=?");