I am not sure how to interpret the result value of the cipher_license pragma. I’m doing this, but it seems not completely sensible:
var stmtLicense: OpaquePointer? = nil
if (sqlite3_prepare(db, "PRAGMA cipher_license = 'foobar';", -1, &stmtLicense, nil) != SQLITE_OK) {
let errmsg = String(cString: sqlite3_errmsg(db))
NSLog("Error preparing SQL for cipher_license code provision: \(errmsg)")
}
if (sqlite3_step(stmtLicense) == SQLITE_ROW) {
NSLog("License result %d", sqlite3_column_int(stmtLicense, 0))
} else {
let errmsg = String(cString: sqlite3_errmsg(db))
NSLog("Unable to provide SQLCipher license code. Error: \(errmsg)")
}