ios设置加密密钥数据库 (Sybase 无线平台)

标签: Sybase ios
发布时间: 2015/3/25 22:04:58
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

此刻我能够设置我本地数据库的加密密钥,请执行以下操作:

 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'

我认为发生的事情是,尽管数据基地成功创建,它还是加密。如何解密它?

解决方法 1:

其实很简单,我只是需要做这每一次,我开始一个会话:

SUPConnectionProfile* cp = [MyDemo_MyDemoDB
                                    getConnectionProfile];
[cp setEncryptionKey:@"Yourkey"];
官方微信
官方QQ群
31647020