On another note, I would like an opinion on the decryption/encryption that
I am using. I have a subclass of CBLMode called OTSCBLModel. It overrides
modelForDocument:encrypted: like this:
+ (CBLModel *) modelForDocument:(CBLDocument *)document
encrypted:(BOOL)encrypted
{
if(encrypted) {
NSString *encryptionKey = [OTSKeychainHelper
keychainStringFromMatchingIdentifier:PROVIDER_ENCRYPTION_KEY];
NSDictionary *dictionary = [OTSCrypter decrypt:document.properties
encryptionKey:encryptionKey];
NSError *error;
[document putProperties:dictionary error:&error];
}
return [self modelForDocument:document];
}
Unfortunately, due to the putProperties:error: call, I now have an
unencrypted document in the db. What I want is to leave the original in the
db encrypted and the in-memory properties unencrypted. I would like
anything on disk to be encrypted but unencrypted for use in the app when I
load them. Also, when I push, the server needs to get encrypted versions.
Is there a way to 'putProperties' in the document that does not update the
document on disk? Then, when I save the model, I would need to encrypt the
in-memory document and save it back to disk for the push, I assume with
putProperties:error:.
On Wednesday, February 12, 2014 4:58:02 PM UTC-8, Jens Alfke wrote:
>
>
> On Feb 12, 2014, at 4:49 PM, Alan McKean <[email protected] <javascript:>>
> wrote:
>
> > I assume it is not persistent since I am not setting it so,
>
> Correct.
>
> > but I get a 409 conflict at the end of the pull on successive launches
> so it makes me think that I am creating another replication on top of the
> previous one.
>
> Hm, weird. You can enable the 'Sync' logging keyword [see the wiki for
> info on logging] and then look through the logs to see if multiple
> CBLPuller instances are running. Look for messages like
> CBLPuller[http:/...] STARTING
> and
> CBLPuller[http:/...] Checkpointing sequence=…
>
> —Jens
>
>
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/eeefb1a1-42bc-44b0-a3d6-4df00c89aee8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.