Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
om_bbdeveloper
Posts: 44
Registered: ‎01-12-2011
My Device: Not Specified

SQLite Database Encryption and Protection

Hi

 

I am trying to do SQLite database ecryption and protection in my project. But I am having a difficult time in doing it. I am using the code given in the SQLite demo. But the real problem, for now, is to sign my .cod file.

 

This is what I have tried.

 

1. I created a public/private key pair using Blackberry Signing Authority Tool.

2. Added the .key file in the project in the src folder.

3. Refreshed the project.

4. Packaged the project.

5. Tried different combinations of signing the file as below

             i) Signed my file only with Blackberry Signing Authority Tool. It was successfully signed but on device while running the app, I got an exception that "your application is trying to access the secured APIs".

             ii) I signed the app with signature tool in Eclipse. It ran successfully on device but it throws ControlledAccessException while encrypting the database at the following line.

 

DatabaseFactory.encrypt(uri,new DatabaseSecurityOptions(codeSigningKey));

 

            iii) Signed first with signature tool and then with blackberry signing authority tool. App runs but the same problem as in (ii).

 

Please suggest where I am doing wrong or please explain the procedure to ecrypt the database. Please do not give the link of the BB docs. I am following that only but not getting successfull.

 

Thanks.

Please use plain text.
Administrator
MSohm
Posts: 14,313
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: SQLite Database Encryption and Protection

I recommend to do all signing in once place, using the SignatureTool in the BlackBerry Java Plug-in for Eclipse.

 

To do this create an account for yourself in your BlackBerry Signing Authority Tool.  This will trigger the email of a csi file to you, similar to when you sign up for RIM code signing keys.  You can then install that in Eclipse and sign everything at once.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Contributor
om_bbdeveloper
Posts: 44
Registered: ‎01-12-2011
My Device: Not Specified

Re: SQLite Database Encryption and Protection

I tried to email the .csi file. but the tool does not allow me to do so. Every time it says that enter right SMTP server name. However, the name is correct. But if I have to sign everything at one place, can't I do it just with the Signing authority tool or with Signature tool only ?

 

Thanks.

Please use plain text.
Administrator
MSohm
Posts: 14,313
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: SQLite Database Encryption and Protection

The Signing Authority tool is only able to sign with the key you created, not the RIM keys.  SignatureTool can sign with both.

 

Make sure you enter a fully qualified mail server name (server.domain.com) for your SMTP server, even if it is local.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.