I've compiled a static library and linked both SQLCipher and OpenSSL. The full project, makefile, and compiled library can be found here:
https://github.com/anujb/SQLCipherNet
When I link the resulting library in a normal Objective-C Xcode project, the call to sqlite3_key
works fine.
I've linked the same library into a MonoTouch project using:
-gcc_flags "-L${ProjectDir} -lsqlciphernet -force_load ${ProjectDir}/libsqlciphernet.a"
Then I've modified SQLite-NET to call the the key function, after every SQLite3.Open(...)
function:
[DllImport("__Internal", EntryPoint = "sqlite3_key")]
public static extern Result Key(IntPtr db, string key, int keyLength);
But I get a EntryPointNotFoundException when the Key method is called. Here's the stack trace:
System.EntryPointNotFoundException has been thrown at:
at (wrapper managed-to-native) SQLite.SQLite3:Decrypt (intptr,string,int)
at SQLite.SQLiteConnection..ctor (System.String databasePath) [0x00031] in
../SQLite.cs:108
Obviously the stacktrace isn't particularly helpful, but I'm at a loss as to where to begin to debug this issue. Halp?