Package org.xipki.ca.server.db
Class CertStoreBase
- java.lang.Object
-
- org.xipki.ca.server.db.CertStoreBase
-
-
Field Summary
Fields Modifier and Type Field Description protected org.xipki.datasource.DataSourceWrappercaConfDatasourceprotected org.xipki.datasource.DataSourceWrapperdatasourceprotected intdbSchemaVersionprotected StringkeypairEncAlgprotected intkeypairEncAlgIdprotected SecretKeykeypairEncKeyprotected StringkeypairEncKeyIdprotected StringkeypairEncProviderprotected intmaxX500nameLenprotected StringSQL_ADD_CERTprotected StringSQL_ADD_CRLprotected static StringSQL_MAX_CRLNOprotected static StringSQL_MAX_FULL_CRLNOprotected static StringSQL_MAX_THISUPDAATE_CRLprotected static StringSQL_REMOVE_CERT_FOR_IDprotected static StringSQL_REVOKE_CERTprotected static StringSQL_REVOKE_SUSPENDED_CERT
-
Constructor Summary
Constructors Modifier Constructor Description protectedCertStoreBase(org.xipki.datasource.DataSourceWrapper datasource, org.xipki.datasource.DataSourceWrapper caConfDatasource, org.xipki.password.PasswordResolver passwordResolver)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static StringbuildArraySql(org.xipki.datasource.DataSourceWrapper datasource, String prefix, int num)protected static org.xipki.security.CertRevocationInfobuildCertRevInfo(org.xipki.ca.server.db.ResultRow rs)protected PreparedStatementbuildPrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... columns)protected PreparedStatementbuildPrepStmt0(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... columns)protected StringbuildSelectFirstSql(String coreSql)protected StringbuildSelectFirstSql(String orderBy, String coreSql)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2col2Bool(Boolean value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2col2Int(Integer value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2col2Long(Long value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2col2Str(String value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2col2Timestamp(Timestamp value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumncolBool(String name, Boolean value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumncolInt(String name, Integer value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumncolLong(String name, Long value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumncolStr(String name, String value)protected static org.xipki.ca.server.db.QueryExecutor.SqlColumncolStr(String name, String value, boolean sensitive, boolean signerConf)protected org.xipki.ca.server.db.ResultRowexecQuery1PrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params)protected org.xipki.ca.server.db.ResultRowexecQuery1PrepStmt0(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params)protected longexecQueryLongPrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params)protected List<org.xipki.ca.server.db.ResultRow>execQueryPrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params)protected List<org.xipki.ca.server.db.ResultRow>execQueryPrepStmt0(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params)protected List<org.xipki.ca.server.db.ResultRow>execQueryStmt(String sql)protected intexecUpdatePrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params)protected intexecUpdatePrepStmt0(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params)protected intexecUpdateStmt(String sql)protected intexecUpdateStmt0(String sql)protected longgetMax(String table, String column)protected voidnotNulls(Object param1, String name1, Object param2, String name2)protected voidnotNulls(Object param1, String name1, Object param2, String name2, Object param3, String name3)protected voidnotNulls(Object param1, String name1, Object param2, String name2, Object param3, String name3, Object param4, String name4)protected static org.xipki.security.X509CertparseCert(byte[] encodedCert)protected PreparedStatementprepareStatement(String sqlQuery)voidupdateDbInfo(org.xipki.password.PasswordResolver passwordResolver)
-
-
-
Field Detail
-
SQL_ADD_CERT
protected final String SQL_ADD_CERT
-
SQL_REVOKE_CERT
protected static final String SQL_REVOKE_CERT
- See Also:
- Constant Field Values
-
SQL_REVOKE_SUSPENDED_CERT
protected static final String SQL_REVOKE_SUSPENDED_CERT
- See Also:
- Constant Field Values
-
SQL_MAX_CRLNO
protected static final String SQL_MAX_CRLNO
- See Also:
- Constant Field Values
-
SQL_MAX_FULL_CRLNO
protected static final String SQL_MAX_FULL_CRLNO
- See Also:
- Constant Field Values
-
SQL_MAX_THISUPDAATE_CRL
protected static final String SQL_MAX_THISUPDAATE_CRL
- See Also:
- Constant Field Values
-
SQL_ADD_CRL
protected final String SQL_ADD_CRL
-
SQL_REMOVE_CERT_FOR_ID
protected static final String SQL_REMOVE_CERT_FOR_ID
- See Also:
- Constant Field Values
-
dbSchemaVersion
protected final int dbSchemaVersion
-
maxX500nameLen
protected final int maxX500nameLen
-
keypairEncAlg
protected final String keypairEncAlg
- See Also:
- Constant Field Values
-
keypairEncAlgId
protected final int keypairEncAlgId
- See Also:
- Constant Field Values
-
keypairEncProvider
protected String keypairEncProvider
-
keypairEncKeyId
protected String keypairEncKeyId
-
keypairEncKey
protected SecretKey keypairEncKey
-
caConfDatasource
protected final org.xipki.datasource.DataSourceWrapper caConfDatasource
-
datasource
protected final org.xipki.datasource.DataSourceWrapper datasource
-
-
Constructor Detail
-
CertStoreBase
protected CertStoreBase(org.xipki.datasource.DataSourceWrapper datasource, org.xipki.datasource.DataSourceWrapper caConfDatasource, org.xipki.password.PasswordResolver passwordResolver) throws org.xipki.datasource.DataAccessException, org.xipki.ca.api.mgmt.CaMgmtException- Throws:
org.xipki.datasource.DataAccessExceptionorg.xipki.ca.api.mgmt.CaMgmtException
-
-
Method Detail
-
updateDbInfo
public void updateDbInfo(org.xipki.password.PasswordResolver passwordResolver) throws org.xipki.datasource.DataAccessException, org.xipki.ca.api.mgmt.CaMgmtException- Throws:
org.xipki.datasource.DataAccessExceptionorg.xipki.ca.api.mgmt.CaMgmtException
-
buildCertRevInfo
protected static org.xipki.security.CertRevocationInfo buildCertRevInfo(org.xipki.ca.server.db.ResultRow rs)
-
getMax
protected long getMax(String table, String column) throws org.xipki.util.exception.OperationException
- Throws:
org.xipki.util.exception.OperationException
-
execUpdateStmt0
protected int execUpdateStmt0(String sql) throws org.xipki.util.exception.OperationException
- Throws:
org.xipki.util.exception.OperationException
-
execUpdatePrepStmt0
protected int execUpdatePrepStmt0(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params) throws org.xipki.util.exception.OperationException
- Throws:
org.xipki.util.exception.OperationException
-
execQuery1PrepStmt0
protected org.xipki.ca.server.db.ResultRow execQuery1PrepStmt0(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params) throws org.xipki.util.exception.OperationException
- Throws:
org.xipki.util.exception.OperationException
-
execQueryPrepStmt0
protected List<org.xipki.ca.server.db.ResultRow> execQueryPrepStmt0(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params) throws org.xipki.util.exception.OperationException
- Throws:
org.xipki.util.exception.OperationException
-
buildPrepStmt0
protected PreparedStatement buildPrepStmt0(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... columns) throws org.xipki.util.exception.OperationException
- Throws:
org.xipki.util.exception.OperationException
-
execQueryLongPrepStmt
protected long execQueryLongPrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params) throws org.xipki.util.exception.OperationException
- Throws:
org.xipki.util.exception.OperationException
-
prepareStatement
protected PreparedStatement prepareStatement(String sqlQuery) throws org.xipki.util.exception.OperationException
- Throws:
org.xipki.util.exception.OperationException
-
buildArraySql
protected static String buildArraySql(org.xipki.datasource.DataSourceWrapper datasource, String prefix, int num)
-
parseCert
protected static org.xipki.security.X509Cert parseCert(byte[] encodedCert) throws org.xipki.util.exception.OperationException- Throws:
org.xipki.util.exception.OperationException
-
colBool
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn colBool(String name, Boolean value)
-
colInt
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn colInt(String name, Integer value)
-
colLong
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn colLong(String name, Long value)
-
colStr
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn colStr(String name, String value)
-
colStr
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn colStr(String name, String value, boolean sensitive, boolean signerConf)
-
col2Bool
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2 col2Bool(Boolean value)
-
col2Int
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2 col2Int(Integer value)
-
col2Long
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2 col2Long(Long value)
-
col2Str
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2 col2Str(String value)
-
col2Timestamp
protected static org.xipki.ca.server.db.QueryExecutor.SqlColumn2 col2Timestamp(Timestamp value)
-
execUpdateStmt
protected int execUpdateStmt(String sql) throws org.xipki.datasource.DataAccessException
- Throws:
org.xipki.datasource.DataAccessException
-
execUpdatePrepStmt
protected int execUpdatePrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params) throws org.xipki.datasource.DataAccessException
- Throws:
org.xipki.datasource.DataAccessException
-
execQueryStmt
protected List<org.xipki.ca.server.db.ResultRow> execQueryStmt(String sql) throws org.xipki.datasource.DataAccessException
- Throws:
org.xipki.datasource.DataAccessException
-
execQuery1PrepStmt
protected org.xipki.ca.server.db.ResultRow execQuery1PrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params) throws org.xipki.datasource.DataAccessException
- Throws:
org.xipki.datasource.DataAccessException
-
execQueryPrepStmt
protected List<org.xipki.ca.server.db.ResultRow> execQueryPrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... params) throws org.xipki.datasource.DataAccessException
- Throws:
org.xipki.datasource.DataAccessException
-
buildPrepStmt
protected PreparedStatement buildPrepStmt(String sql, org.xipki.ca.server.db.QueryExecutor.SqlColumn2... columns) throws org.xipki.datasource.DataAccessException
- Throws:
org.xipki.datasource.DataAccessException
-
notNulls
protected void notNulls(Object param1, String name1, Object param2, String name2, Object param3, String name3)
-
-