美文网首页
Sqlite3 中与加密相关接口

Sqlite3 中与加密相关接口

作者: 环零弦 | 来源:发表于2017-08-01 20:29 被阅读0次
     #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 */
      );
    

    参考资料:

    相关文章

      网友评论

          本文标题:Sqlite3 中与加密相关接口

          本文链接:https://www.haomeiwen.com/subject/dwrslxtx.html