}
- public CertificateStatus getStatus() {
+ public synchronized CertificateStatus getStatus() {
if (id == 0) {
return CertificateStatus.DRAFT;
}
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;
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=?");