2011-12-21 22 views
7

Tại thời điểm này tôi có thể thiết lập các khóa mã hóa cho cơ sở dữ liệu địa phương của tôi bằng cách làm như sau:Thiết chìa khóa mã hóa cho cơ sở dữ liệu (Sybase Unwired Platform)

if(![MyDemo_MyDemoDB databaseExists]){ 
     SUPConnectionProfile* cp = [MyDemo_MyDemoDB 
            getConnectionProfile]; 
     [cp setEncryptionKey:@"Yourkey"]; 
     [MyDemo_MyDemoDB closeConnection]; 
    } 

Vì vậy, khi người dùng của tôi đăng nhập thành công (bằng cách cung cấp mật khẩu chính xác cho SUPDataVault), tôi nhận được lỗi sau:

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' 

những gì tôi nghĩ đang xảy ra là mặc dù các cơ sở dữ liệu được tạo thành công, nó vẫn được mã hóa. Làm thế nào để giải mã nó?

Trả lời

4

Nó khá đơn giản thực sự, tôi chỉ cần làm mọi này tôi đang bắt đầu một phiên:

SUPConnectionProfile* cp = [MyDemo_MyDemoDB 
            getConnectionProfile]; 
[cp setEncryptionKey:@"Yourkey"]; 
Các vấn đề liên quan