EOSIO / eosio-swift-vault

Utility library for managing keys and signing with Apple's Keychain and Secure Enclave
https://eosio.github.io/eosio-swift-vault/
MIT License
12 stars 8 forks source link

Enable the ability to pass access flags and protection (Biofactor) when importing or creating key via keychain #47

Closed ismyhc closed 4 years ago

ismyhc commented 4 years ago

In certain scenarios it is needed to set access flags and/or the protection level when creating or importing a key into the keychain.

This pull request adds the needed function arguments and implementations to make that possible. Also the added function arguments have default values set to what the previous implementation would have done.

Im free to any changes to how I've done it or a completely different approach. Doesn't matter to me, but Lynx needs these abilities and I would love to use eosio-swift-vault.

brandonfancher commented 4 years ago

Perfect timing, @ismyhc! We were literally now preparing to cut new releases with various non-breaking changes...among them Swift 5. We'll review this and see if we can't get it into the release too.

ismyhc commented 4 years ago

Perfect timing, @ismyhc! We were literally now preparing to cut new releases with various non-breaking changes...among them Swift 5. We'll review this and see if we can't get it into the release too.

Awesome. Here is on concern I have with the vault. Currently in lynx I use the .userPresence flag to require always a prompt for faceId/passcode when retrieving an item from keychain. For some reason when using the vault implementation when setting the SecAccessControlCreateFlags to .userPresence or .biometryAny and importing an external key, im never prompted when calling getVaultKey. I would expect to be prompted for faceID when trying to access this keychain item. Of course I could be doing something wrong, but comparing my current keychain implementation with the vault's, I don't really so much difference.

Any thoughts or guidance would be much appreciated.

mjohnson12 commented 4 years ago

I've captured these changes in a branch in this repository in a branch. Closing so I can merge that branch.