src/it/finsiel/siged/dao/jdbc/FirmaDigitaleDAOjdbc.java
public void salvaListaCertificatiRevocati(Set revokedCerts, int caId,
            int crlId) throws DataException {
        Connection connection = null;
        PreparedStatement pstmt = null;
        try {
            connection = jdbcMan.getConnection();
            connection.setAutoCommit(false);
            pstmt = connection
                    .prepareStatement(DELETE_REVOKED_CERTIFICATES_BY_CA_ID);
            pstmt.setInt(1, caId);
            pstmt.executeUpdate();
            pstmt.close();
            if (revokedCerts != null) {
                // inserisco i certificati revocati
                Iterator it = revokedCerts.iterator();
                while (it.hasNext()) {
                    X509CRLEntry entry = (X509CRLEntry) it.next();
                    pstmt = connection
                            .prepareStatement(INSERT_REVOKED_CERT_ENTRY);
                    pstmt.setInt(1, caId);
                    pstmt.setString(2, entry.getSerialNumber().toString());
                    pstmt.setDate(3, new Date(entry.getRevocationDate()
                            .getTime()));
                    pstmt.executeUpdate();
                    pstmt.close();
                }
            }
            setStatoErroreCRL(connection, crlId, Parametri.CRL_OK);
            connection.commit();
        } catch (Exception e) {
            logger.error("", e);
            jdbcMan.rollback(connection);
            throw new DataException(e.getMessage());
        } finally {
            jdbcMan.close(connection);
        }
    }
/*
     * Aggiorna la lista dei certificati revocati per la CA in argomento.
     * Elimina ogni record presente ed inserisce i nuovi (set in argomento)
     */
Aggiorna la lista dei certificati revocati per la CA in argomento.
Elimina ogni record presente ed inserisce i nuovi (set in argomento)
Aggiorna la lista dei certificati revocati per la CA in argomento . Elimina ogni record presente ed inserisce i nuovi ( set in argomento )
public void salvaListaCertificatiRevocati(Set revokedCerts, int caId,
            int crlId) throws DataException {
        Connection connection = null;
        PreparedStatement pstmt = null;
        try {
            connection = jdbcMan.getConnection();
            connection.setAutoCommit(false);
            pstmt = connection
                    .prepareStatement(DELETE_REVOKED_CERTIFICATES_BY_CA_ID);
            pstmt.setInt(1, caId);
            pstmt.executeUpdate();
            pstmt.close();
            if (revokedCerts != null) {
                Iterator it = revokedCerts.iterator();
                while (it.hasNext()) {
                    X509CRLEntry entry = (X509CRLEntry) it.next();
                    pstmt = connection
                            .prepareStatement(INSERT_REVOKED_CERT_ENTRY);
                    pstmt.setInt(1, caId);
                    pstmt.setString(2, entry.getSerialNumber().toString());
                    pstmt.setDate(3, new Date(entry.getRevocationDate()
                            .getTime()));
                    pstmt.executeUpdate();
                    pstmt.close();
                }
            }
            setStatoErroreCRL(connection, crlId, Parametri.CRL_OK);
            connection.commit();
        } catch (Exception e) {
            logger.error("", e);
            jdbcMan.rollback(connection);
            throw new DataException(e.getMessage());
        } finally {
            jdbcMan.close(connection);
        }
    }
public void salvaListaCertificatiRevocati ( Set revokedCerts , int caId , int crlId ) throws DataException { Connection connection = null ; PreparedStatement pstmt = null ; try { connection = jdbcMan . getConnection ( ) ; connection . setAutoCommit ( false ) ; pstmt = connection . prepareStatement ( DELETE_REVOKED_CERTIFICATES_BY_CA_ID ) ; pstmt . setInt ( 1 , caId ) ; pstmt . executeUpdate ( ) ; pstmt . close ( ) ; if ( revokedCerts != null ) { Iterator it = revokedCerts . iterator ( ) ; while ( it . hasNext ( ) ) { X509CRLEntry entry = ( X509CRLEntry ) it . next ( ) ; pstmt = connection . prepareStatement ( INSERT_REVOKED_CERT_ENTRY ) ; pstmt . setInt ( 1 , caId ) ; pstmt . setString ( 2 , entry . getSerialNumber ( ) . toString ( ) ) ; pstmt . setDate ( 3 , new Date ( entry . getRevocationDate ( ) . getTime ( ) ) ) ; pstmt . executeUpdate ( ) ; pstmt . close ( ) ; } } setStatoErroreCRL ( connection , crlId , Parametri . CRL_OK ) ; connection . commit ( ) ; } catch ( Exception e ) { logger . error ( "" , e ) ; jdbcMan . rollback ( connection ) ; throw new DataException ( e . getMessage ( ) ) ; } finally { jdbcMan . close ( connection ) ; } }
Aggiorna la lista dei certificati revocati per la CA in argomento.
Aggiorna la lista dei certificati revocati per la CA in argomento .
// inserisco i certificati revocati