Closed jordanekay closed 8 years ago
Basically I want to be able to save/restore objects to/from the keychain, but only those which conform to NSSecureCoding.
Any update on whether this is a good idea, or how I should improve it?
What I am not thrilled about is adding the NSData+Base64 category to Lockbox.
What would be more interesting is to add the method signatures you suggest and then implement them in a way that simply takes the data they represent without further encoding them and storing/retrieving that in/from the keychain.
As it stands now, Lockbox boils everything down to an NSString and stores that. But you should be able to store NSData as is in the keychain. So you'd have to re-factor what I've done a bit to achieve that.
The keychain accepts binary data. You don't need to boil everything down to strings. That would make almost all of the inner workings of this class better. For example, storing a dictionary simply requires running it through an NSArchiver
instead of doing the funky string conversion that is done now.
That would be good. The manual string-separator can't be very robust.
I have just pushed an update to Lockbox that deprecates all the setXxx
and related getters, and added methods for archiving and unarchiving objects of any kind that conform to NSSecureCoding
.
Based on my reading of the NSSecureCoding docs, I am not sure you have correctly conformed Lockbox to this protocol.
What is it you are aiming to achieve with this pull request? (I may be totally missing something, so I am asking with all due respect to you and your contribution, of course!)