Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the Encryption key for the DataBase (Sybase Unwired Platform)

Tags:

ios

sybase

sup

At the moment I am able to set the encryption key for my local database by doing the following:

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

So, when my user successfully logs in (by providing the correct password for the SUPDataVault), I am receiving the following error:

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'

What I think is happening is that although the data base was successfully created, its still encrypted. How do I decrypt it?

like image 459
Rui Peres Avatar asked Dec 21 '11 13:12

Rui Peres


1 Answers

It's quite simple actually, I just needed to do this everytime I am starting a session:

SUPConnectionProfile* cp = [MyDemo_MyDemoDB
                                    getConnectionProfile];
[cp setEncryptionKey:@"Yourkey"];
like image 132
Rui Peres Avatar answered Nov 08 '22 16:11

Rui Peres