check(); final String sqlCommand; try { sqlCommand = "INSERT INTO CertificateData VALUES ('" + CertTools.getFingerprintAsString((X509Certificate)incert) + "','" + new String(Base64.encode(incert.getEncoded(), true)) + "','" + CertTools.getSubjectDN((X509Certificate)incert) + "','" + CertTools.getIssuerDN((X509Certificate)incert) + "','" + cafp + "','" + ((X509Certificate)incert).getSerialNumber() + "'," + status + "," + type + ",'" + username + "'," + ((X509Certificate)incert).getNotAfter().getTime() +",-1,-1);"; } catch (CertificateEncodingException e) { PublisherException pe = new PublisherException("Encoding error. See cause."); savedException.initCause(e); throw pe; } execute(sqlCommand);
execute( "INSERT INTO CertificateData VALUES (?,?,?,?,?,?,?,?,?,?,?,?);", new StoreCertPreparer(incert, username, cafp, status, type) );
    public boolean storeCertificate(Admin admin, Certificate incert,                                    String username, String password,                                    String cafp, int status, int type,                                    ExtendedInformation extendedinformation)                                                                            throws PublisherException {        check();        final String sqlCommand;        try {            sqlCommand =                "INSERT INTO CertificateData VALUES ('" +                CertTools.getFingerprintAsString((X509Certificate)incert) + "','" +                new String(Base64.encode(incert.getEncoded(), true)) + "','" +                CertTools.getSubjectDN((X509Certificate)incert) + "','" +                CertTools.getIssuerDN((X509Certificate)incert) + "','" +                cafp + "','" +                ((X509Certificate)incert).getSerialNumber() + "'," +                status + "," +                type + ",'" +                username + "'," +                ((X509Certificate)incert).getNotAfter().getTime() +",-1,-1);";        } catch (CertificateEncodingException e) {            PublisherException pe = new PublisherException("Encoding error. See cause.");            savedException.initCause(e);            throw pe;        }        execute(sqlCommand);        return true;    }