Sqlite3 中与加密相关接口

 #ifdef SQLITE_HAS_CODEC
 /*
  ** Specify the key for an encrypted database.  This routine should be
  ** called right after sqlite3_open().
  **
  ** The code to implement this API is not available in the public release
  ** of SQLite.
  */
  SQLITE_API int sqlite3_key(
    sqlite3 *db,                   /* Database to be rekeyed */
    const void *pKey, int nKey     /* The key */
  );
  SQLITE_API int sqlite3_key_v2(
    sqlite3 *db,                   /* Database to be rekeyed */
    const char *zDbName,           /* Name of the database */
    const void *pKey, int nKey     /* The key */
  );

  /*
  ** Change the key on an open database.  If the current database is not
  ** encrypted, this routine will encrypt it.  If pNew==0 or nNew==0, the
  ** database is decrypted.
  **
  ** The code to implement this API is not available in the public release
  ** of SQLite.
  */
  SQLITE_API int sqlite3_rekey(
    sqlite3 *db,                   /* Database to be rekeyed */
    const void *pKey, int nKey     /* The new key */
  );
  SQLITE_API int sqlite3_rekey_v2(
    sqlite3 *db,                   /* Database to be rekeyed */
    const char *zDbName,           /* Name of the database */
    const void *pKey, int nKey     /* The new key */
  );

  SQLITE_API int sqlite3_open(
    const char *filename,   /* Database filename (UTF-8) */
    sqlite3 **ppDb          /* OUT: SQLite db handle */
  );

  SQLITE_API int sqlite3_close(sqlite3*);

  SQLITE_API int sqlite3_exec(
    sqlite3*,                                  /* An open database */
    const char *sql,                           /* SQL to be evaluated */
    int (*callback)(void*,int,char**,char**),  /* Callback function */
    void *,                                    /* 1st argument to callback */
    char **errmsg                              /* Error msg written here */
  );

参考资料:

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容