I am trying out Baikal for its CardDAV functionality in order to provide my users with addressbook functionality on iOS.
I have created a desktop application and expect to be able to create a BLOB from this app, with VCard data, and insert it to a MySQL table for Baikal to see it as valid addressbook data. The tricky part is that I want to ask the user for an encryption key to setup their CardDAV account on Baikal. My hope is that I would pass this key to an encryption function in order to encrypt a vcard and store it as a BLOB on Baikal's MySQL database. To retrieve the CardDAV contacts on the user's iOS (iphone) device, I would somehow ask users to add their key as a parameter to the connection URL of Baikal. Finally I would use this parameter to decrypt each user's cards. So, if my user's addressbook is at http://myserver/baikal/html/dav.php/user1/default, I would ask them to add the parameter like this: http://myserver/baikal/html/dav.php/user1/default?p=12345678
In that way, only the user would know the way to decrypt their data and Baikal would be safe if it ever fell on a hacker's hands.
Does this make sense? Any idea on where to start?