Create a helper class for the Keychain #68
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is very early on, but I couldn't resist learning about the Keychain! Let's spill the beans about how it works:
keys
, Identity = keys/cert?, Certificate =cert
, Generic Password =genp
, Internet Password =inet
)kSecAttrServer
attribute (at least according to ChatGPT :P).kSecValueData
. To decrypt it, a password may be required. On iOS, you may need to use biometrics instead. I enabled this flag for better security, but we'll see how much this impacts the UX.kSecAttrAccessible
and/orkSecAttrAccessControl
control whether a passcode is required to decrypt a Keychain item.kSecAttrAccessGroup
. The apps need to share the same team ID (signed by the same provisioning profile). The access group is prioritized as follows:keychain-access-group
strings requiring the Keychain Sharing capabilitycom.apple.security.application-groups
strings requiring the App Groups capability (the same IPC method to share UserDefaults between apps)agrp
column in thegenp
table, which happens to be one of the only plaintext portions of the table. So that can be used to determine if a JWT is stored in the EZ Recipes app.