ios – 设置DataBase的加密密钥(Sybase Unwired Platform)

目前,我可以通过执行以下操作为本地数据库设置加密密钥:
if(![MyDemo_MyDemoDB databaseExists]){
        SUPConnectionProfile* cp = [MyDemo_MyDemoDB
                                    getConnectionProfile];
        [cp setEncryptionKey:@"Yourkey"];
        [MyDemo_MyDemoDB closeConnection];
    }

因此,当我的用户成功登录时(通过提供SUPDataVault的正确密码),我收到以下错误

ERROR sup_sqlite_db_ConnectionWrapperImpl.m:62 dynamicStatement: There is an exception file is encrypted or is not a database
2011-12-21 13:32:05.112 MyDemo10389:11603 MBODebugLogger: SUPPersistenceException SUPPersistenceException from find: -- sup_sqlite_db_StatementWrapperImpl: There is an exception null value for sqlite3_stmt
2011-12-21 13:32:05.225 MyDemo10389:11603 *** Terminating app due to uncaught exception 'SUPPersistenceException',reason: 'SUPPersistenceException from find: -- sup_sqlite_db_StatementWrapperImpl: There is an exception null value for sqlite3_stmt'

我认为正在发生的是,虽然数据库已成功创建,但仍然是加密的.我该如何解密?

解决方法

实际上这很简单,我每次开始会话时都需要这样做:
SUPConnectionProfile* cp = [MyDemo_MyDemoDB
                                    getConnectionProfile];
[cp setEncryptionKey:@"Yourkey"];

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...