1、下载最新的sqlite3:sqlite-amalgamation-3080700,打开,里面有四个文件:shell.c,sqlite3.c,sqlite3.h,sqlite3ext.h.
2、打开sqlite3.h文件,可见如下代码(大约在代码的四千六百行左右):
#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