📄 certdb.h
字号:
#ifndef __CERTDB_H_ #define __CERTDB_H_#include <stdlib.h>#include <string.h>#include <iostream>#include <openssl/x509.h>#include <NggObject.h>#include <mysql.h>#include <errmsg.h>using namespace std;class CertDB{public: CertDB(); ~CertDB(); void showInformation(); bool importCertToDB(string dn, X509* cert, string serialNumber, string type="user", string priv="", string action="insert"); char* exportCertToUser(string name, string dn="", string action=""); bool importCertListToDB(string dn, string certlist, string serialNumber, string type="gw", string priv="", string action="insert"); bool findCertInDB(string username, string dn=""); bool delCertFromDB(string type, string username, string dn=""); bool updateCertToDB(string dn, X509* cert, string type="user", string priv=""); bool updateCertListToDB(string dn, string certlist, string type="gw", string priv=""); bool importCRLToDB(char* crl, string action="insert", string issuer=""); char* exportCRLFromDB(string type="local"); bool updateCRL(char* crl); bool checkWhetherUserHaveExisted(const char* DN); bool connectDBServer(); bool initCADB(); bool createCertChain(); bool createCRLChain(); bool initializeConnect(); string m_swap;private: MYSQL *m_sql; MYSQL_ROW m_row; MYSQL_RES *m_result; bool m_findNumber; string m_server, m_username, m_password, m_db; string getIssuer(string dn); string parseXML(string xml, string type="get", string keyword="", string attr="", string value=""); string locateInXML(NggObject* object, string type="get", string keyword="", string attr="", string value=""); string readCAConfig(string keyword, string object); bool execute(string sql, string type="read"); bool handleShell(string shell); void createDB();public: void closeDB(); void closeConnection();};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -